
#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@hs01 ghc-backpack]$ cat A.hs {-# LANGUAGE RoleAnnotations #-} module A where data Maybe a = AF type role Maybe representational [ezyang@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