[GHC] #10263: Role annotation should never be ambiguous

GHC ghc-devs at haskell.org
Wed Apr 8 01:55:51 UTC 2015


#10263: Role annotation should never be ambiguous
-------------------------------------+-------------------------------------
              Reporter:  ezyang      |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.11
  (Type checker)                     |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  GHC rejects
          Architecture:              |  valid program
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 {{{
 [ezyang at hs01 ghc-backpack]$ cat A.hs
 {-# LANGUAGE RoleAnnotations #-}
 module A where
 data Maybe a = AF
 type role Maybe representational
 [ezyang at hs01 ghc-backpack]$ ghc -c A.hs

 A.hs:4:11:
     Ambiguous occurrence ‘Maybe’
     It could refer to either ‘A.Maybe’, defined at A.hs:3:1
                           or ‘Prelude.Maybe’,
                              imported from ‘Prelude’ at A.hs:2:8
                              (and originally defined in ‘GHC.Base’)
 }}}

 This is silly because roles can only ever be defined with the declaration,
 so only one reference makes sense.

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


More information about the ghc-tickets mailing list