[GHC] #8773: Require -XIncoherentInstances to write role annotations on class definitions
#8773: Require -XIncoherentInstances to write role annotations on class definitions ------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8745 | ------------------------------------+------------------------------------- With a role annotation declaring a representational role for a class parameter, it is very easy to create instance incoherence. See [https://ghc.haskell.org/trac/ghc/ticket/8745#comment:5 this comment]. The solution: require `-XIncoherentInstances` when writing such a role annotation. This also has the knock-on effect (happily) of preventing such shenanigans in Safe Haskell. Class role annotations asking GHC to infer roles or with nominal roles, although rather useless, will still be accepted without `-XIncoherentInstances`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8773: Require -XIncoherentInstances to write role annotations on class definitions -------------------------------------+------------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8745 -------------------------------------+------------------------------------ Changes (by nomeata): * cc: mail@… (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8773: Require -XIncoherentInstances to write role annotations on class definitions -------------------------------------+------------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #8745 -------------------------------------+------------------------------------ Changes (by thoughtpolice): * milestone: => 7.8.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8773: Require -XIncoherentInstances to write role annotations on class definitions -------------------------------------+------------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: 8745 | Related Tickets: #8745 -------------------------------------+------------------------------------ Comment (by Richard Eisenberg <eir@…>): In [changeset:"138297585f88351352e0ed878b25f26e1d6edfef/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="138297585f88351352e0ed878b25f26e1d6edfef" Fix #8773. To make a role annotation on a class asserting a role other than nominal, you now need -XIncoherentInstances. See the ticket for more information as to why this is a good idea. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8773: Require -XIncoherentInstances to write role annotations on class definitions --------------------------------------------+------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: roles/should_fail/T8773 | Difficulty: Unknown Blocking: 8745 | Blocked By: | Related Tickets: #8745 --------------------------------------------+------------------------------ Changes (by goldfire): * status: new => merge * testcase: => roles/should_fail/T8773 Comment: I think (once again) that GND and `coerce` are Safe. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8773: Require -XIncoherentInstances to write role annotations on class definitions --------------------------------------------+------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: roles/should_fail/T8773 | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8745 --------------------------------------------+------------------------------ Comment (by Austin Seipp <austin@…>): In [changeset:"a8a01e742434df11b830ab99af12d9045dfcbc4b/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="a8a01e742434df11b830ab99af12d9045dfcbc4b" Fix #8745 - GND is now -XSafe compatible. As discussed in the ticket, after the landing of #8773, GND is now -XSafe compatible. This fixes the test fallout as well. In particular SafeLang07 was removed following in the steps of SafeLang06, since it no longer failed from GND, but failed due to roles and was thus invalid. The other tests were tweaked to use TemplateHaskell instead of GND in order to trigger safety warnings. Signed-off-by: Austin Seipp <austin@well-typed.com> }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8773: Require -XIncoherentInstances to write role annotations on class definitions --------------------------------------------+------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: roles/should_fail/T8773 | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8745 --------------------------------------------+------------------------------ Comment (by thoughtpolice): Merged in 7.8. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8773: Require -XIncoherentInstances to write role annotations on class definitions --------------------------------------------+------------------------------ Reporter: goldfire | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: roles/should_fail/T8773 | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8745 --------------------------------------------+------------------------------ Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8773#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC