Skip to content

Commit 1bfdb69

Browse files
committed
ES: bugfix in TrivialCaseElimination
1 parent 8c39025 commit 1bfdb69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

grin/src/Transformations/ExtendedSyntax/Optimising/TrivialCaseElimination.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ trivialCaseElimination :: Exp -> Exp
99
trivialCaseElimination = ana builder where
1010
builder :: Exp -> ExpF Exp
1111
builder = \case
12-
ECase scrut [Alt DefaultPat _altName body] -> SBlockF body
13-
ECase scrut [Alt cpat _altName body] -> SBlockF $ EBind (SReturn (Var scrut)) (cPatToAsPat scrut cpat) body
12+
ECase scrut [Alt DefaultPat altName body] -> SBlockF $ EBind (SReturn (Var scrut)) (VarPat altName) body
13+
ECase scrut [Alt cpat altName body] -> SBlockF $ EBind (SReturn (Var scrut)) (cPatToAsPat altName cpat) body
1414
exp -> project exp

0 commit comments

Comments
 (0)