Commit 29f7c103 authored by Joachim Breitner's avatar Joachim Breitner

New lint check: exprIsHNF = True and alts = [] is bogus

parent 5449b25d
......@@ -637,6 +637,9 @@ lintCoreExpr e@(Case scrut var alt_ty alts) =
; alt_ty <- lintInTy alt_ty
; var_ty <- lintInTy (idType var)
; checkL (not (null alts && exprIsHNF scrut))
(ptext (sLit "No alternatives for a case scrutinee in head-normal form:") <+> ppr scrut)
; case tyConAppTyCon_maybe (idType var) of
Just tycon
| debugIsOn &&
......
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