[project @ 2003-11-17 14:40:33 by simonmar]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcTyDecls.lhs
index e67cabe..11d6858 100644 (file)
@@ -25,7 +25,7 @@ import RnHsSyn                ( extractHsTyNames )
 import Type            ( predTypeRep )
 import BuildTyCl       ( newTyConRhs )
 import HscTypes                ( TyThing(..) )
-import TyCon            ( TyCon, ArgVrcs, tyConArity, tyConDataCons_maybe, tyConDataCons, tyConTyVars,
+import TyCon            ( TyCon, ArgVrcs, tyConArity, tyConDataCons, tyConTyVars,
                           getSynTyConDefn, isSynTyCon, isAlgTyCon, isHiBootTyCon,
                          tyConName, isNewTyCon, isProductTyCon, tyConArgVrcs )
 import Class           ( classTyCon )
@@ -36,7 +36,6 @@ import Name           ( Name, isTyVarName )
 import NameEnv
 import NameSet
 import Digraph                 ( SCC(..), stronglyConnComp, stronglyConnCompR )
-import Maybe           ( isNothing )
 import BasicTypes      ( RecFlag(..) )
 import Outputable
 \end{code}
@@ -333,11 +332,7 @@ calcTyConArgVrcs tyclss
     initial_oi :: NameEnv (TyCon, ArgVrcs)
     initial_oi = mkNameEnv [(tyConName tc, (tc, initial tc))
                           | tc <- tycons]
-    initial tc = if isAlgTyCon tc && isNothing (tyConDataCons_maybe tc) then
-                         -- make pessimistic assumption (and warn)
-                         abstractVrcs tc
-                       else
-                         replicate (tyConArity tc) (False,False)
+    initial tc = replicate (tyConArity tc) (False,False)
 
     tcaoFix :: NameEnv (TyCon, ArgVrcs)   -- initial ArgVrcs per tycon
            -> NameEnv (TyCon, ArgVrcs)   -- fixpointed ArgVrcs per tycon
@@ -358,10 +353,7 @@ calcTyConArgVrcs tyclss
             -> ArgVrcs                   -- new ArgVrcs for tycon
 
     tcaoIter oi tc | isAlgTyCon tc
-      = if null data_cons then
-           abstractVrcs tc             -- Data types with no constructors
-       else
-            map (\v -> anyVrc (vrcInTy (lookup oi) v) argtys) vs
+      = map (\v -> anyVrc (vrcInTy (lookup oi) v) argtys) vs
       where
                data_cons = tyConDataCons tc
                vs        = tyConTyVars tc
@@ -376,20 +368,6 @@ calcTyConArgVrcs tyclss
                        Just (_, pms) -> pms
                        Nothing       -> tyConArgVrcs tc
         -- We use the already-computed result for tycons not in this SCC
-
-
-abstractVrcs :: TyCon -> ArgVrcs
-abstractVrcs tc = 
-#ifdef DEBUG
-                  pprTrace "Vrc: abstract tycon:" (ppr tc) $
-#endif
-                  warn_abstract_vrcs `seq` replicate (tyConArity tc) (True,True)
-
-warn_abstract_vrcs
--- we pull the message out as a CAF so the warning only appears *once*
-  = trace ("WARNING: tyConArgVrc info inaccurate due to unavailable constructors.\n"
-        ++ "         Use -fno-prune-tydecls to fix.") $
-                ()
 \end{code}