[GHC] #9518: Improve error message for unacceptable role annotations

GHC ghc-devs at haskell.org
Wed Nov 12 00:19:07 UTC 2014


#9518: Improve error message for unacceptable role annotations
-------------------------------------+-------------------------------------
              Reporter:  dmcclean    |            Owner:
                  Type:  feature     |           Status:  infoneeded
  request                            |        Milestone:
              Priority:  low         |          Version:  7.8.3
             Component:  Compiler    |         Keywords:
  (Type checker)                     |     Architecture:  Unknown/Multiple
            Resolution:              |       Difficulty:  Unknown
      Operating System:              |       Blocked By:
  Unknown/Multiple                   |  Related Tickets:
       Type of failure:              |
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by dmcclean):

 I'm sorry guys, I haven't been haskelling much in the last couple of
 months.

 I can't remember how to construct an example, in part because I am still
 confused by what the rules are, which is why I had trouble interpreting
 the original error message.

 To elaborate on what I find confusing about it, I think that it would help
 if it said *where* `a` was used in a context that required a nominal type
 role, in the same way that some of the other type error messages do.

 Annotation says representation but role nominal is required, arising from
 use of (type constructor) in the type expression (...) at (...)

 I have a terrible headache or I would research the rules again to figure
 out how to write a program that produces this error on purpose. I'll
 attempt it tomorrow if there's time.

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


More information about the ghc-tickets mailing list