[GHC] #14101: Type synonyms can make roles too conservative

GHC ghc-devs at haskell.org
Tue Aug 8 19:58:56 UTC 2017


#14101: Type synonyms can make roles too conservative
-------------------------------------+-------------------------------------
           Reporter:  dfeuer         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.4.1
          Component:  Compiler       |           Version:  8.2.1
  (Type checker)                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 import GHC.Exts

 type Arr# = Array#

 data Foo a = Foo (Arr# a)

 type role Foo representational
 }}}

 produces

 {{{
  error:
     • Role mismatch on variable a:
         Annotation says representational but role nominal is required
     • while checking a role annotation for ‘Foo’
 }}}

 If the type synonym is instead defined

 {{{#!hs
 type Arr# a = Array# a
 }}}

 then it works fine.

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


More information about the ghc-tickets mailing list