[GHC] #2851: Improve error message for failed deriving

GHC trac at galois.com
Tue Dec 30 12:05:11 EST 2008


#2851: Improve error message for failed deriving
-------------------------------------------+--------------------------------
    Reporter:  guest                       |        Owner:  igloo           
        Type:  merge                       |       Status:  new             
    Priority:  normal                      |    Milestone:                  
   Component:  Compiler (Type checker)     |      Version:  6.10.1          
    Severity:  minor                       |   Resolution:                  
    Keywords:                              |   Difficulty:  Unknown         
    Testcase:  deriving/should_fail/T2851  |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple            |  
-------------------------------------------+--------------------------------
Changes (by simonpj):

  * testcase:  => deriving/should_fail/T2851
  * status:  reopened => new
  * type:  feature request => merge
  * owner:  => igloo

Comment:

 OK, I've done that
 {{{
 Tue Dec 30 16:59:06 GMT 2008  simonpj at microsoft.com
   * Improve error message in deriving (fix Trac #2851)
 }}}
 The error now says:
 {{{
 T2851.hs:8:14:
     No instance for (Show (F a))
       arising from the 'deriving' clause of a data type declaration
                    at T2851.hs:8:14-17
     Possible fix: add an instance declaration for (Show (F a))
     Alternative fix: use a standalone 'deriving instance' declaration
 instead,
       so you can specify the instance context yourself
     When deriving the instance for (Show (D a))
 }}}
 Please merge.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2851#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list