[project @ 2001-08-20 16:15:34 by simonmar]
authorsimonmar <unknown>
Mon, 20 Aug 2001 16:15:34 +0000 (16:15 +0000)
committersimonmar <unknown>
Mon, 20 Aug 2001 16:15:34 +0000 (16:15 +0000)
Do something vaguely useful in ifaceTyCls when presented with a
primitive type constructor.  We pretend it's an abstract data type for
now.

ghc/compiler/main/MkIface.lhs

index eb7b663..98a160f 100644 (file)
@@ -16,6 +16,7 @@ module MkIface (
 import HsSyn
 import HsCore          ( HsIdInfo(..), UfExpr(..), toUfExpr, toUfBndr )
 import HsTypes         ( toHsTyVars )
+import TysPrim         ( alphaTyVars )
 import BasicTypes      ( Fixity(..), NewOrData(..),
                          Version, initialVersion, bumpVersion, 
                        )
@@ -45,9 +46,10 @@ import Name          ( getName, nameModule, toRdrName, isGlobalName,
 import NameEnv
 import NameSet
 import OccName         ( pprOccName )
-import TyCon           ( TyCon, getSynTyConDefn, isSynTyCon, isNewTyCon, isAlgTyCon, tyConGenIds,
-                         tyConTheta, tyConTyVars, tyConDataCons, tyConFamilySize, 
-                         isClassTyCon, isForeignTyCon
+import TyCon           ( TyCon, getSynTyConDefn, isSynTyCon, isNewTyCon, 
+                         isAlgTyCon, tyConGenIds, tyConTheta, tyConTyVars,
+                         tyConDataCons, tyConFamilySize, isPrimTyCon,
+                         isClassTyCon, isForeignTyCon, tyConArity
                        )
 import Class           ( classExtraBigSig, classTyCon, DefMeth(..) )
 import FieldLabel      ( fieldLabelType )
@@ -203,6 +205,18 @@ ifaceTyCls (ATyCon tycon) = ty_decl
                            tcdFoType = DNType, -- The only case at present
                            tcdLoc    = noSrcLoc }
 
+           | isPrimTyCon tycon
+               -- needed in GHCi for ':info Int#', for example
+           = TyData {  tcdND     = DataType,
+                       tcdCtxt   = [],
+                       tcdName   = getName tycon,
+                       tcdTyVars = toHsTyVars (take (tyConArity tycon) alphaTyVars),
+                       tcdCons   = [],
+                       tcdNCons  = 0,
+                       tcdDerivs = Nothing,
+                       tcdSysNames  = [],
+                       tcdLoc       = noSrcLoc }
+
            | otherwise = pprPanic "ifaceTyCls" (ppr tycon)
 
     tyvars      = tyConTyVars tycon