diff --git a/compiler/minils/transformations/inline_extvalues.ml b/compiler/minils/transformations/inline_extvalues.ml index 77beda2..f416cbe 100644 --- a/compiler/minils/transformations/inline_extvalues.ml +++ b/compiler/minils/transformations/inline_extvalues.ml @@ -54,9 +54,11 @@ let gather_extvalues_node nd = | _ -> false in + let inlinable w = Linearity.is_linear w.w_linearity in + let gather_extvalues_eq _ env eq = let env = match eq.eq_lhs, eq.eq_rhs.e_desc with - | Evarpat x, Eextvalue w when not (changed_type w) -> Env.add x w env + | Evarpat x, Eextvalue w when not (changed_type w) && inlinable w -> Env.add x w env | _ -> env in eq, env