|
@@ -1722,13 +1722,13 @@ and type_new ctx path el with_type force_inline p =
|
|
|
error "Constructor is not a function" p
|
|
|
in
|
|
|
let t = if (fst path).tparams <> [] then
|
|
|
- follow (Typeload.load_instance ctx path false)
|
|
|
+ Typeload.load_instance ctx path false
|
|
|
else try
|
|
|
ctx.call_argument_stack <- el :: ctx.call_argument_stack;
|
|
|
- let t = follow (Typeload.load_instance ctx path true) in
|
|
|
+ let t = Typeload.load_instance ctx path true in
|
|
|
ctx.call_argument_stack <- List.tl ctx.call_argument_stack;
|
|
|
(* Try to properly build @:generic classes here (issue #2016) *)
|
|
|
- begin match t with
|
|
|
+ begin match follow t with
|
|
|
| TInst({cl_kind = KGeneric } as c,tl) -> follow (Generic.build_generic ctx c p tl)
|
|
|
| _ -> t
|
|
|
end
|
|
@@ -1760,6 +1760,7 @@ and type_new ctx path el with_type force_inline p =
|
|
|
error ((s_type_path (t_infos mt).mt_path) ^ " cannot be constructed") p
|
|
|
in
|
|
|
DisplayEmitter.check_display_type ctx t (pos path);
|
|
|
+ let t = follow t in
|
|
|
let build_constructor_call c tl =
|
|
|
let ct, f = get_constructor ctx c tl p in
|
|
|
check_constructor_access ctx c f p;
|