#1432: Poor type error messages (refer to generated code rather than the higher
level problem)
--------------------------------------------+-------------------------------
  Reporter:  igloo                          |          Owner:         
      Type:  bug                            |         Status:  new    
  Priority:  high                           |      Milestone:  6.8    
 Component:  Compiler (Type checker)        |        Version:  6.6.1  
  Severity:  normal                         |       Keywords:         
Difficulty:  Unknown                        |             Os:  Unknown
  Testcase:  tcfail046,tcfail169,tcfail118  |   Architecture:  Unknown
--------------------------------------------+-------------------------------
With this module:
 {{{
 module Foo where

 data Foo a = Foo
 data Bar a = Bar (Foo a)
     deriving Eq
 }}}
 the HEAD says:
 {{{
 q.hs:5:0:
     Non type-variable argument in the constraint: Eq (Foo a)
     (Use -fglasgow-exts to permit this)
     In the context: (Eq (Foo a))
     While checking the context of an instance declaration
     In the derived instance: (Eq (Foo a)) => Eq (Bar a)
 }}}
 which isn't really the error message that we want, as it's refering to the
 generated instance.

 6.6 gives the much better:
 {{{
 q.hs:5:5:
     No instance for (Eq (Foo a))
       arising from the 'deriving' clause of a data type declaration
       at q.hs:5:5
     Possible fix: add an instance declaration for (Eq (Foo a))
     When deriving the instance for `Eq (Bar a)'
 }}}

 This example is from tcfail046; tcfail169 is similar and tcfail118 is also
 a related issue.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1432>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to