git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Recurse into case expressions when checking exhaustivity
commit93fd3b7196c07497961bc518edbb0e31d0900cf0 authorPhil Freeman <paf31@cantab.net> dateTue 13 Oct 2015, 16:07 (11 years ago) parent4eb79ad
2 files changed+2−1
.gitignore+1 src/Language/PureScript/Linter/Exhaustive.hs+1−1
.gitignore+1
@@ -15,3 +15,4 @@ node_modules
1515tmp/
1616.stack-work/
1717tests/support/flattened/
18+output
src/Language/PureScript/Linter/Exhaustive.hs+1−1
@@ -292,7 +292,7 @@ checkExhaustiveDecls env mn = mapM_ onDecl
292292 onExpr (Abs _ e) = onExpr e
293293 onExpr (App e1 e2) = onExpr e1 >> onExpr e2
294294 onExpr (IfThenElse e1 e2 e3) = onExpr e1 >> onExpr e2 >> onExpr e3
295− onExpr (Case es cas) = checkExhaustive env mn (length es) cas >> mapM_ onCaseAlternative cas
295+ onExpr (Case es cas) = checkExhaustive env mn (length es) cas >> mapM_ onExpr es >> mapM_ onCaseAlternative cas
296296 onExpr (TypedValue _ e _) = onExpr e
297297 onExpr (Let ds e) = mapM_ onDecl ds >> onExpr e
298298 onExpr (PositionedValue pos _ e) = censor (addHint (PositionedError pos)) (onExpr e)