|
@@ -499,7 +499,7 @@ let rec type_binop ctx op e1 e2 is_assign_op with_type p =
|
|
| _ -> assert false
|
|
| _ -> assert false
|
|
end;
|
|
end;
|
|
make_call ctx e1 [ethis;Texpr.Builder.make_string ctx.t fname null_pos;e2] t p
|
|
make_call ctx e1 [ethis;Texpr.Builder.make_string ctx.t fname null_pos;e2] t p
|
|
- | AKUsing(ef,_,_,et) ->
|
|
|
|
|
|
+ | AKUsing(ef,_,_,et,_) ->
|
|
(* this must be an abstract setter *)
|
|
(* this must be an abstract setter *)
|
|
let e2,ret = match follow ef.etype with
|
|
let e2,ret = match follow ef.etype with
|
|
| TFun([_;(_,_,t)],ret) ->
|
|
| TFun([_;(_,_,t)],ret) ->
|
|
@@ -582,7 +582,7 @@ let rec type_binop ctx op e1 e2 is_assign_op with_type p =
|
|
mk (TVar (v,Some e)) ctx.t.tvoid p;
|
|
mk (TVar (v,Some e)) ctx.t.tvoid p;
|
|
e'
|
|
e'
|
|
]) 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) | _ -> assert false in
|
|
let ta = match c.cl_kind with KAbstractImpl a -> TAbstract(a, List.map (fun _ -> mk_mono()) a.a_params) | _ -> assert false in
|
|
let ret = match follow ef.etype with
|
|
let ret = match follow ef.etype with
|
|
@@ -1704,7 +1704,7 @@ and type_object_decl ctx fl with_type p =
|
|
mk (TBlock (List.rev (e :: (List.rev evars)))) e.etype e.epos
|
|
mk (TBlock (List.rev (e :: (List.rev evars)))) e.etype e.epos
|
|
)
|
|
)
|
|
|
|
|
|
-and type_new ctx path el with_type p =
|
|
|
|
|
|
+and type_new ctx path el with_type force_inline p =
|
|
let unify_constructor_call c params f ct = match follow ct with
|
|
let unify_constructor_call c params f ct = match follow ct with
|
|
| TFun (args,r) ->
|
|
| TFun (args,r) ->
|
|
(try
|
|
(try
|
|
@@ -1775,7 +1775,7 @@ and type_new ctx path el with_type p =
|
|
let ta = TAnon { a_fields = c.cl_statics; a_status = ref (Statics c) } in
|
|
let ta = TAnon { a_fields = c.cl_statics; a_status = ref (Statics c) } in
|
|
let e = mk (TTypeExpr (TClassDecl c)) ta p in
|
|
let e = mk (TTypeExpr (TClassDecl c)) ta p in
|
|
let e = mk (TField (e,(FStatic (c,cf)))) ct p in
|
|
let e = mk (TField (e,(FStatic (c,cf)))) ct p in
|
|
- make_call ctx e el t p
|
|
|
|
|
|
+ make_call ctx e el t ~force_inline p
|
|
| TInst (c,params) | TAbstract({a_impl = Some c},params) ->
|
|
| TInst (c,params) | TAbstract({a_impl = Some c},params) ->
|
|
let el,_,_ = build_constructor_call c params in
|
|
let el,_,_ = build_constructor_call c params in
|
|
mk (TNew (c,params,el)) t p
|
|
mk (TNew (c,params,el)) t p
|
|
@@ -2226,7 +2226,7 @@ and type_meta ctx m e1 with_type p =
|
|
| ECall(e1,el) ->
|
|
| ECall(e1,el) ->
|
|
type_call ctx e1 el WithType.value true p
|
|
type_call ctx e1 el WithType.value true p
|
|
| ENew (t,el) ->
|
|
| ENew (t,el) ->
|
|
- let e = type_new ctx t el with_type p in
|
|
|
|
|
|
+ let e = type_new ctx t el with_type true p in
|
|
{e with eexpr = TMeta((Meta.Inline,[],null_pos),e)}
|
|
{e with eexpr = TMeta((Meta.Inline,[],null_pos),e)}
|
|
| EFunction(Some(_) as name,e1) ->
|
|
| EFunction(Some(_) as name,e1) ->
|
|
type_local_function ctx name true e1 with_type p
|
|
type_local_function ctx name true e1 with_type p
|
|
@@ -2253,14 +2253,15 @@ and type_call ctx e el (with_type:WithType.t) inline p =
|
|
| None ->
|
|
| None ->
|
|
e
|
|
e
|
|
end;
|
|
end;
|
|
|
|
+ | AKUsing(e,c,cf,ef,_) ->
|
|
|
|
+ AKUsing(e,c,cf,ef,true)
|
|
| AKExpr {eexpr = TLocal _} ->
|
|
| AKExpr {eexpr = TLocal _} ->
|
|
display_error ctx "Cannot force inline on local functions" p;
|
|
display_error ctx "Cannot force inline on local functions" p;
|
|
e
|
|
e
|
|
| _ ->
|
|
| _ ->
|
|
e
|
|
e
|
|
in
|
|
in
|
|
- let e = build_call ctx e el with_type p in
|
|
|
|
- e
|
|
|
|
|
|
+ build_call ctx e el with_type p
|
|
in
|
|
in
|
|
match e, el with
|
|
match e, el with
|
|
| (EConst (Ident "trace"),p) , e :: el ->
|
|
| (EConst (Ident "trace"),p) , e :: el ->
|
|
@@ -2435,7 +2436,7 @@ and type_expr ctx (e,p) (with_type:WithType.t) =
|
|
| ECall (e,el) ->
|
|
| ECall (e,el) ->
|
|
type_call ctx e el with_type false p
|
|
type_call ctx e el with_type false p
|
|
| ENew (t,el) ->
|
|
| ENew (t,el) ->
|
|
- type_new ctx t el with_type p
|
|
|
|
|
|
+ type_new ctx t el with_type false p
|
|
| EUnop (op,flag,e) ->
|
|
| EUnop (op,flag,e) ->
|
|
type_unop ctx op flag e p
|
|
type_unop ctx op flag e p
|
|
| EFunction (name,f) ->
|
|
| EFunction (name,f) ->
|