[cvs-nhc98] patch applied (hat): Remove bug in type checker and addition of some error messages.

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Oct 10 07:23:56 EDT 2006


Thu Feb 20 10:23:30 PST 2003  olaf
  * Remove bug in type checker and addition of some error messages.
  
  Type unification in TypeUnify was wrong!
  Given two types c t1 ... tn and c s1 ... sn unification would just unify the two list of arguments. However, if c is a type synonym, this is wrong! A type synonym always has to be expanded. Example:
  
  type T a = Int
  
  Then unifying T Bool and T Int should not force unification of Bool and Int!
  
  With the removal of this bug the Hat transformed Prelude type checks again in nhc98 (instead of producing obscure error "The class Main.Integral has no instance for the type Hat.Hat.List.")
  
  
  
  Also extended error message "The class ... has no instance for the type ..." so that it gives additional position information.
  
  Furthermore the renamer (defineDefaultMethod) did fall over if a method was also declared outside of the class. Now an appropriate error message is produced.

    M ./src/compiler98/Derive.hs -1 +1
    M ./src/compiler98/RenameLib.hs +5
    M ./src/compiler98/Type.hs -1 +1
    M ./src/compiler98/TypeCtx.hs -14 +18
    M ./src/compiler98/TypeUnify.hs -1 +6
    M ./src/hatlib/PreludeBasic.hs -5 +2


More information about the Cvs-nhc98 mailing list