|
@@ -462,20 +462,14 @@ let rec type_inline ctx cf f ethis params tret config p ?(self_calling_closure=f
|
|
|
l.i_write <- true;
|
|
|
let e2 = map false e2 in
|
|
|
{e with eexpr = TBinop(op,{e1 with eexpr = TLocal l.i_subst},e2)}
|
|
|
-(* | TCall({eexpr = TLocal v} as e1,el) ->
|
|
|
- let el = List.map (map false) el in
|
|
|
- let l = read_local v in
|
|
|
- let edef() = {e with eexpr = TCall({e1 with eexpr = TLocal l.i_subst},el)} in
|
|
|
- begin try
|
|
|
- begin match List.assq l inlined_vars with
|
|
|
- | {eexpr = TField(_, (FStatic(_,cf) | FInstance(_,_,cf)))} as e' when cf.cf_kind = Method MethInline ->
|
|
|
- make_call ctx e' el e.etype e.epos
|
|
|
+ | TObjectDecl fl ->
|
|
|
+ let fl = List.map (fun (s,e) -> s,map false e) fl in
|
|
|
+ begin match follow e.etype with
|
|
|
+ | TAnon an when (match !(an.a_status) with Const -> true | _ -> false) ->
|
|
|
+ {e with eexpr = TObjectDecl fl; etype = TAnon { an with a_status = ref Closed}}
|
|
|
| _ ->
|
|
|
- edef()
|
|
|
- end
|
|
|
- with Not_found ->
|
|
|
- edef()
|
|
|
- end *)
|
|
|
+ {e with eexpr = TObjectDecl fl}
|
|
|
+ end
|
|
|
| TFunction f ->
|
|
|
(match f.tf_args with [] -> () | _ -> has_vars := true);
|
|
|
let old = save_locals ctx and old_fun = !in_local_fun in
|