[GHC] #9204: Conflicting definition in hs-boot file

GHC ghc-devs at haskell.org
Sun Feb 8 00:09:51 UTC 2015


#9204: Conflicting definition in hs-boot file
-------------------------------------+-------------------------------------
        Reporter:  Feuerbach         |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  low               |               Milestone:  7.12.1
       Component:  Documentation     |                 Version:  7.8.2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |  roles/should_fail/T9204
                                     |                Blocking:
                                     |  Differential Revisions:  Phab:D458
-------------------------------------+-------------------------------------
Changes (by goldfire):

 * owner:  goldfire =>
 * priority:  normal => low
 * status:  closed => new
 * resolution:  fixed =>
 * milestone:   => 7.12.1


Comment:

 Yes, the suggestion in comment:8 is reasonable: Use `phantom` as the
 default role in hs-boot files when the definition is supplied. Even today,
 GHC does do role inference in hs-boot files -- it just uses a different
 default. But there is no reason to change the default if a definition is
 supplied.

 Thanks for the suggestion.

 However, because this is a user-facing change, it's not appropriate (in my
 opinion) to make the change for 7.10. And, it's just barely possible that
 this will break code. The following compiles today:

 A.hs-boot:

 {{{
 module A where

 data P a = P
 }}}

 A.hs:

 {{{
 module A where

 type role P representational
 data P a = P
 }}}

 Under the proposed change, this example would fail due to the missing role
 annotation in the hs-boot file. That said, I'm still in favor of the
 change, just documenting what would break.

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


More information about the ghc-tickets mailing list