[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

#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

#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