Skip to content

Commit

Permalink
Filter out immutable ValDefs from rewritings.
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbolliger authored and jad-hamza committed May 25, 2021
1 parent 980ad46 commit 7f78b2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ trait AntiAliasing
} else {
val newScrut = transform(scrut, env)
val newCases = cses.map { case mc @ MatchCase(pattern, guard, rhs) =>
val newRewritings = mapForPattern(newScrut, pattern)
val newRewritings =
mapForPattern(newScrut, pattern).filterKeys(v => isMutableType(v.getType))

val newGuard = guard.map(transform(_, env withRewritings newRewritings))
val newRhs = transform(rhs, env withRewritings newRewritings)
MatchCase(pattern, newGuard, newRhs).copiedFrom(mc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object CastCorrectness {
}

@pure
def remove_from_list(var0: List[Int]): Unit = {
def removeFromList(var0: List[Int]): Unit = {
var list: List[Int] = freshCopy(var0)
list match {
case Cons(first_elem, _) =>
Expand Down

0 comments on commit 7f78b2c

Please sign in to comment.