Commit 6401879f authored by Fredrik Wieczerkowski's avatar Fredrik Wieczerkowski

Emit warning correctly for multi-guard case branches

Consider case branches where any guard is always true to be
exhaustive.
parent 002edd7d
......@@ -719,7 +719,7 @@ processEqs eqs@((n, ps, gs):eqs')
| all isVarPat firstPats = processVars eqs
| otherwise = internalError "Checks.WarnCheck.processEqs"
where firstPats = map firstPat eqs
guardsExhaustive = null gs || all guardAlwaysTrue gs
guardsExhaustive = null gs || any guardAlwaysTrue gs
guardAlwaysTrue :: CondExpr () -> Bool
guardAlwaysTrue (CondExpr _ e _) = case e of
Constructor _ _ q -> qidAlwaysTrue q
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment