The boot interface files for TypeRep contain errors

Tobias Gedell d99getob at dtek.chalmers.se
Thu Feb 6 08:14:29 EST 2003


The boot interface files for .../ghc/compiler/types/TypeRep.lhs contain 
errors.


In TypeRep.lhs PredType is defined as:

-----
type PredType  = SourceType	-- A subtype for predicates
-----


But in the boot files it is exported as a datatype (taken from 
TypeRep.hi-boot-6):

-----
module TypeRep where

data Type
data PredType
type Kind = Type
type SuperKind = Type
-----

When compiling GHC this doesn't matter, the compilation succeeds anyway. 
The error shows up first when generating external Core for GHC. Since 
PredType is exported as a datatype it will be refered to by all modules 
that are using the boot file, but when generating external Core for 
TypeRep the type PredType will be removed since it is just an alias. 
Therefore there will be a lot of references to the nonexisting type 
TypeRep.PredType.


The solution is to define PredType as a type in the boot files and add 
the type SourceType as a datatype.


Here are the modified boot files:

TypeRep.hi-boot:
-----
_interface_ TypeRep 1
_exports_ TypeRep Type SourceType PredType Kind SuperKind ;
_declarations_
1 data Type ;
1 data SourceType ;
1 type PredType = SourceType;
1 type Kind = Type ;
1 type SuperKind = Type ;
-----


TypeRep.hi-boot-5
-----
__interface TypeRep 1 0 where
__export TypeRep Type SourceType PredType Kind SuperKind ;
1 data Type ;
1 data SourceType ;
1 type PredType = SourceType ;
1 type Kind = Type ;
1 type SuperKind = Type ;
-----


TypeRep.hi-boot-6
-----
module TypeRep where

data Type
data SourceType
type PredType = SourceType
type Kind = Type
type SuperKind = Type
-----



Should I commit these changes to the HEAD branch?



Regards,
  Tobias




More information about the Glasgow-haskell-bugs mailing list