|
@@ -20,12 +20,21 @@ let unify_cf map_type c cf el =
|
|
|
match follow (apply_params cf.cf_params monos (map_type cf.cf_type)) with
|
|
|
| TFun(tl'',_) as tf ->
|
|
|
let rec loop2 acc el tl = match el,tl with
|
|
|
- | e :: el,(n,o,t) :: tl ->
|
|
|
+ | e :: el,(_,o,t) :: tl ->
|
|
|
begin try
|
|
|
Type.unify e.etype t;
|
|
|
loop2 ((e,o) :: acc) el tl
|
|
|
with _ ->
|
|
|
- None
|
|
|
+ match t,tl with
|
|
|
+ | TAbstract({a_path=["haxe";"extern"],"Rest"},[t]),[] ->
|
|
|
+ begin try
|
|
|
+ let el = List.map (fun e -> unify t e.etype; e,o) el in
|
|
|
+ Some ((List.rev acc) @ el,tf,(c,cf,monos))
|
|
|
+ with _ ->
|
|
|
+ None
|
|
|
+ end
|
|
|
+ | _ ->
|
|
|
+ None
|
|
|
end
|
|
|
| [],[] ->
|
|
|
Some ((List.rev acc),tf,(c,cf,monos))
|