Rejig error reporting in the unifier slightly
[ghc-hetmet.git] / compiler / iface / TcIface.lhs
index adde9fb..e1a6d2b 100644 (file)
@@ -58,8 +58,9 @@ import Maybes
 import SrcLoc
 import DynFlags
 import Util
-import Control.Monad
+import FastString
 
+import Control.Monad
 import Data.List
 import Data.Maybe
 \end{code}
@@ -814,10 +815,8 @@ tcIfaceAlt _ _ (IfaceLitAlt lit, names, rhs)
 -- work them out.  True enough, but its not that easy!
 tcIfaceAlt scrut (tycon, inst_tys) (IfaceDataAlt data_occ, arg_strs, rhs)
   = do { con <- tcIfaceDataCon data_occ
-#ifdef DEBUG
-       ; when (not (con `elem` tyConDataCons tycon))
+       ; when (debugIsOn && not (con `elem` tyConDataCons tycon))
               (failIfM (ppr scrut $$ ppr con $$ ppr tycon $$ ppr (tyConDataCons tycon)))
-#endif
        ; tcIfaceDataAlt con inst_tys arg_strs rhs }
                  
 tcIfaceAlt _ (tycon, inst_tys) (IfaceTupleAlt boxity, arg_occs, rhs)