Require -XIncoherentInstances to write role annotations on class definitions
|Reported by:||goldfire||Owned by:||goldfire|
|Type of failure:||None/Unknown||Test Case:||roles/should_fail/T8773|
|Related Tickets:||#8745||Differential Revisions:|
With a role annotation declaring a representational role for a class parameter, it is very easy to create instance incoherence. See 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.
Change History (9)
comment:5 Changed 14 months ago by goldfire
- Status changed from new to merge
- Test Case set to roles/should_fail/T8773