[GHC] #11509: Incorrect error message in StandaloneDeriving: "The data constructors of <typeclass> are not all in scope"

GHC ghc-devs at haskell.org
Fri Jan 29 14:47:54 UTC 2016


#11509: Incorrect error message in StandaloneDeriving: "The data constructors of
<typeclass> are not all in scope"
-------------------------------------+-------------------------------------
        Reporter:  edsko             |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1-rc1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Ha!  Interesting.  The error message embodies the assumption that in
 {{{
 instance .. => C (T a b c)
 }}}
 that `T` is an algebraic data type; but here is is a class.   So a
 question arises:

 * Does GND work for classes?  Well, does this work?
 {{{
 instance (Typeable a, SC (Serializable a)) => SC (Serializable (MyList a))
 where
    dict = coerce (dict :: Static (Dict (Serializable [a])))
 }}}
   If we got past the test, I think that's what we'd generate.  I suspect
 you'll get a similar error from the `corece`, but try it.

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


More information about the ghc-tickets mailing list