|
@@ -1012,7 +1012,7 @@ and type_binop2 ?(abstract_overload_only=false) ctx op (e1 : texpr) (e2 : Ast.ex
|
|
|
| TFun([(_,_,t1);(_,_,t2)],tret) ->
|
|
|
let check e1 e2 swapped =
|
|
|
let map_arguments () =
|
|
|
- let monos = List.map (fun _ -> mk_mono()) cf.cf_params in
|
|
|
+ let monos = spawn_constrained_monos ctx p (fun t -> t) cf.cf_params in
|
|
|
let map t = map (apply_params cf.cf_params monos t) in
|
|
|
let t1 = map t1 in
|
|
|
let t2 = map t2 in
|
|
@@ -1794,7 +1794,7 @@ and type_new ctx path el with_type force_inline p =
|
|
|
(* Try to infer generic parameters from the argument list (issue #2044) *)
|
|
|
begin match resolve_typedef (Typeload.load_type_def ctx p (fst path)) with
|
|
|
| TClassDecl ({cl_constructor = Some cf} as c) ->
|
|
|
- let monos = List.map (fun _ -> mk_mono()) c.cl_params in
|
|
|
+ let monos = spawn_constrained_monos ctx p (fun t -> t) c.cl_params in
|
|
|
let ct, f = get_constructor ctx c monos p in
|
|
|
ignore (unify_constructor_call c monos f ct);
|
|
|
begin try
|
|
@@ -2403,8 +2403,10 @@ and type_call_target ctx e with_type inline p =
|
|
|
|
|
|
and type_call ?(mode=MGet) ctx e el (with_type:WithType.t) inline p =
|
|
|
let def () =
|
|
|
- let e = type_call_target ctx e with_type inline p in
|
|
|
- build_call ~mode ctx e el with_type p
|
|
|
+ with_contextual_monos ctx (fun () ->
|
|
|
+ let e = type_call_target ctx e with_type inline p in
|
|
|
+ build_call ~mode ctx e el with_type p;
|
|
|
+ )
|
|
|
in
|
|
|
match e, el with
|
|
|
| (EConst (Ident "trace"),p) , e :: el ->
|
|
@@ -2695,6 +2697,10 @@ let rec create com =
|
|
|
opened = [];
|
|
|
vthis = None;
|
|
|
in_call_args = false;
|
|
|
+ monomorphs = {
|
|
|
+ percall = [];
|
|
|
+ perfunction = [];
|
|
|
+ };
|
|
|
on_error = (fun ctx msg p -> ctx.com.error msg p);
|
|
|
memory_marker = Typecore.memory_marker;
|
|
|
} in
|