Skip to content

Commit 1a0c731

Browse files
committed
Do not remove inlined mutable vars
1 parent bddc912 commit 1a0c731

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fsharp/symbols/Exprs.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -852,15 +852,15 @@ module FSharpExprConvert =
852852
None, env.BindIsInstVal bind.Var (ty, e)
853853

854854
// Remove let <compilerGeneratedVar> = <var> from quotation tree
855-
| Expr.Val _ when bind.Var.IsCompilerGenerated ->
855+
| Expr.Val _ when bind.Var.IsCompilerGenerated && (not bind.Var.IsMutable) ->
856856
None, env.BindSubstVal bind.Var bind.Expr
857857

858858
// Remove let <compilerGeneratedVar> = () from quotation tree
859-
| Expr.Const(Const.Unit, _, _) when bind.Var.IsCompilerGenerated ->
859+
| Expr.Const(Const.Unit, _, _) when bind.Var.IsCompilerGenerated && (not bind.Var.IsMutable) ->
860860
None, env.BindSubstVal bind.Var bind.Expr
861861

862862
// Remove let unionCase = ... from quotation tree
863-
| Expr.Op(TOp.UnionCaseProof _, _, [e], _) ->
863+
| Expr.Op(TOp.UnionCaseProof _, _, [e], _) when (not bind.Var.IsMutable) ->
864864
None, env.BindSubstVal bind.Var e
865865

866866
| _ ->

0 commit comments

Comments
 (0)