|
@@ -358,16 +358,16 @@ let rec type_inline ctx cf f ethis params tret config p force =
|
|
let force = ref force in
|
|
let force = ref force in
|
|
let vars = List.fold_left (fun acc (i,e) ->
|
|
let vars = List.fold_left (fun acc (i,e) ->
|
|
let flag = not i.i_force_temp && (match e.eexpr with
|
|
let flag = not i.i_force_temp && (match e.eexpr with
|
|
- | TLocal {v_extra = _,true} -> true
|
|
|
|
|
|
+ | TLocal v when Meta.has Meta.This v.v_meta -> true
|
|
| TLocal _ | TConst _ -> not i.i_write
|
|
| TLocal _ | TConst _ -> not i.i_write
|
|
| TFunction _ -> if i.i_write then error "Cannot modify a closure parameter inside inline method" p; true
|
|
| TFunction _ -> if i.i_write then error "Cannot modify a closure parameter inside inline method" p; true
|
|
| _ -> not i.i_write && i.i_read <= 1
|
|
| _ -> not i.i_write && i.i_read <= 1
|
|
) in
|
|
) in
|
|
let flag = flag && (not i.i_captured || is_constant e) in
|
|
let flag = flag && (not i.i_captured || is_constant e) in
|
|
(* force inlining if we modify 'this' *)
|
|
(* force inlining if we modify 'this' *)
|
|
- if i.i_write && snd i.i_var.v_extra then force := true;
|
|
|
|
|
|
+ if i.i_write && (Meta.has Meta.This i.i_var.v_meta) then force := true;
|
|
(* force inlining of 'this' variable if it is written *)
|
|
(* force inlining of 'this' variable if it is written *)
|
|
- let flag = if not flag && snd i.i_var.v_extra && i.i_write then begin
|
|
|
|
|
|
+ let flag = if not flag && (Meta.has Meta.This i.i_var.v_meta) && i.i_write then begin
|
|
if not (is_writable e) then error "Cannot modify the abstract value, store it into a local first" p;
|
|
if not (is_writable e) then error "Cannot modify the abstract value, store it into a local first" p;
|
|
true
|
|
true
|
|
end else flag in
|
|
end else flag in
|