|
@@ -632,7 +632,7 @@ let rec type_binop ctx op e1 e2 is_assign_op with_type p =
|
|
]) t p
|
|
]) t p
|
|
| AKUsing(ef,c,cf,et,_) ->
|
|
| AKUsing(ef,c,cf,et,_) ->
|
|
(* abstract setter + getter *)
|
|
(* abstract setter + getter *)
|
|
- let ta = match c.cl_kind with KAbstractImpl a -> TAbstract(a, List.map (fun _ -> mk_mono()) a.a_params) | _ -> die "" __LOC__ in
|
|
|
|
|
|
+ let ta = match c.cl_kind with KAbstractImpl a -> TAbstract(a,Monomorph.spawn_constrained_monos (fun t -> t) a.a_params) | _ -> die "" __LOC__ in
|
|
let ret = match follow ef.etype with
|
|
let ret = match follow ef.etype with
|
|
| TFun([_;_],ret) -> ret
|
|
| TFun([_;_],ret) -> ret
|
|
| _ -> error "Invalid field type for abstract setter" p
|
|
| _ -> error "Invalid field type for abstract setter" p
|
|
@@ -1396,7 +1396,7 @@ and type_access ctx e p mode =
|
|
| TTypeExpr (TClassDecl c) ->
|
|
| TTypeExpr (TClassDecl c) ->
|
|
if mode = MSet then error "Cannot set constructor" p;
|
|
if mode = MSet then error "Cannot set constructor" p;
|
|
if mode = MCall then error ("Cannot call constructor like this, use 'new " ^ (s_type_path c.cl_path) ^ "()' instead") p;
|
|
if mode = MCall then error ("Cannot call constructor like this, use 'new " ^ (s_type_path c.cl_path) ^ "()' instead") p;
|
|
- let monos = List.map (fun _ -> mk_mono()) (match c.cl_kind with KAbstractImpl a -> a.a_params | _ -> c.cl_params) in
|
|
|
|
|
|
+ let monos = Monomorph.spawn_constrained_monos (fun t -> t) (match c.cl_kind with KAbstractImpl a -> a.a_params | _ -> c.cl_params) in
|
|
let ct, cf = get_constructor ctx c monos p in
|
|
let ct, cf = get_constructor ctx c monos p in
|
|
check_constructor_access ctx c cf p;
|
|
check_constructor_access ctx c cf p;
|
|
let args = match follow ct with TFun(args,ret) -> args | _ -> die "" __LOC__ in
|
|
let args = match follow ct with TFun(args,ret) -> args | _ -> die "" __LOC__ in
|