File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
core/src/main/scala/stainless/ast Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -144,9 +144,11 @@ trait SymbolOps extends inox.ast.SymbolOps { self: TypeOps =>
144144
145145 def rewritePM (e : Expr ): Option [Expr ] = e match {
146146 case m @ MatchExpr (scrut, cases) =>
147+ val scrutVd = ValDef .fresh(" scrut" , scrut.getType).setPos(m)
148+ val scrutV = scrutVd.toVariable
147149 val condsAndRhs = for (cse <- cases) yield {
148- val map = mapForPattern(scrut , cse.pattern)
149- val patCond = conditionForPattern[Path ](scrut , cse.pattern, includeBinders = false )
150+ val map = mapForPattern(scrutV , cse.pattern)
151+ val patCond = conditionForPattern[Path ](scrutV , cse.pattern, includeBinders = false )
150152 val realCond = cse.optGuard match {
151153 case Some (g) => patCond withCond replaceFromSymbols(map, g)
152154 case None => patCond
@@ -170,7 +172,7 @@ trait SymbolOps extends inox.ast.SymbolOps { self: TypeOps =>
170172 }
171173 })
172174
173- Some (bigIte)
175+ Some (Let (scrutVd, scrut, bigIte).copiedFrom(m) )
174176
175177 case _ => None
176178 }
You can’t perform that action at this time.
0 commit comments