[GHC] #8485: Type roles in GHCi
#8485: Type roles in GHCi ------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- This works: {{{ λ> data A a; type role A nominal λ> :i A type role A nominal data A a }}} This doesn't: {{{ λ> data A a λ> type role A nominal λ> :i A type role A phantom data A a }}} Accepting role annotations after the definition probably leads to problems when intermediate definitions relied on the earlier role; so I think the second situation should give an error. In fact, in the second snippet GHC does not even require -XRoleAnnotations. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8485> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8485: Type roles in GHCi -------------------------------------+------------------------------------ Reporter: monoidal | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by simonpj): * owner: => goldfire Comment: You are right... the latter should be rejected, just as if you'd given a type signature with no accompanying value declaration. I'm sure Richard will look at this. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8485#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8485: Type roles in GHCi -------------------------------------+------------------------------------ Reporter: monoidal | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Richard Eisenberg <eir@…>): In [changeset:"9366e0191cab2de94f8a8a52decd759d1bf147b7/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="9366e0191cab2de94f8a8a52decd759d1bf147b7" Fix Trac #8485. The problem was that the renamer treated role annotations by looking up the annotated type in the module being compiled. If this check succeeded, it was assumed that the annotated type was being compiled at the same time. But this assumption is false! In GHCi (and Template Haskell), sometimes compilation within one module can be staged. So, now there is a more intricate check for orphan role annotations. This also has the benefit of producing better error messages. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8485#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8485: Type roles in GHCi -------------------------------------+------------------------------------ Reporter: monoidal | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Richard Eisenberg <eir@…>): In [changeset:"d8e49672dbe4281f50137cdaf3fc84256e050457/testsuite"]: {{{ #!CommitTicketReference repository="testsuite" revision="d8e49672dbe4281f50137cdaf3fc84256e050457" Add test for #8485. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8485#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8485: Type roles in GHCi ---------------------------------------+----------------------------------- Reporter: monoidal | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: ghci/scripts/T8485 | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ---------------------------------------+----------------------------------- Changes (by goldfire): * status: new => closed * testcase: => ghci/scripts/T8485 * resolution: => fixed Comment: Fixed -- thanks for pointing this out! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8485#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC