Commit 5cd52635 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-08-20 16:15:34 by simonmar]

Do something vaguely useful in ifaceTyCls when presented with a
primitive type constructor.  We pretend it's an abstract data type for
now.
parent 63ea1af6
......@@ -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
......
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