-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c085855
commit 5bb2f29
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...e-index/messages/GHC-97170/doubleRoleAnnotationOnData/after/DoubleRoleAnnotationOnData.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{-# LANGUAGE RoleAnnotations #-} | ||
module DoubleRoleAnnotationOnData where | ||
|
||
data Foo a = MkFoo a | ||
type role Foo nominal |
6 changes: 6 additions & 0 deletions
6
...-index/messages/GHC-97170/doubleRoleAnnotationOnData/before/DoubleRoleAnnotationOnData.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{-# LANGUAGE RoleAnnotations #-} | ||
module DoubleRoleAnnotationOnData where | ||
|
||
data Foo a = MkFoo a | ||
type role Foo nominal | ||
type role Foo representational |
18 changes: 18 additions & 0 deletions
18
message-index/messages/GHC-97170/doubleRoleAnnotationOnData/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Double role annotation on datatype | ||
--- | ||
|
||
## Error Message | ||
|
||
``` | ||
DoubleRoleAnnotationOnData.hs:6:1: error: [GHC-97170] | ||
Duplicate role annotations for ‘Foo’: | ||
type role Foo nominal | ||
-- written at DoubleRoleAnnotationOnData.hs:5:1-21 | ||
type role Foo representational | ||
-- written at DoubleRoleAnnotationOnData.hs:6:1-30 | ||
| | ||
6 | type role Foo representational | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Duplicate role annotations | ||
summary: A type declaration has more than one accompanying role annotation | ||
severity: error | ||
introduced: 9.8.1 | ||
--- | ||
|
||
This error occurs if more than one role annotation occurs for a given datatype. | ||
Note that the role annotations need not be conflicting for this error to arise. | ||
Also note that the role annotations can occur in different locations from the | ||
datatype. |