Tidy up the handling of wild-card binders, and make Lint check it
[ghc-hetmet.git] / compiler / coreSyn / CoreLint.lhs
index 0ca5c43..428cda8 100644 (file)
@@ -227,7 +227,11 @@ lintCoreExpr (Var var)
   = do { checkL (not (var == oneTupleDataConId))
                 (ptext (sLit "Illegal one-tuple"))
 
-       ; checkDeadIdOcc var
+        ; checkL (not (var `hasKey` wildCardKey))
+                 (ptext (sLit "Occurence of a wild-card binder") <+> ppr var)
+                 -- See Note [WildCard binders] in SimplEnv
+
+        ; checkDeadIdOcc var
        ; var' <- lookupIdInScope var
         ; return (idType var') }