File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed
message-index/messages/GHC-97170
doubleRoleAnnotationOnData Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE RoleAnnotations #-}
2
+ module DoubleRoleAnnotationOnData where
3
+
4
+ data Foo a = MkFoo a
5
+ type role Foo nominal
Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE RoleAnnotations #-}
2
+ module DoubleRoleAnnotationOnData where
3
+
4
+ data Foo a = MkFoo a
5
+ type role Foo nominal
6
+ type role Foo representational
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Double role annotation on datatype
3
+ ---
4
+
5
+ ## Error Message
6
+
7
+ ```
8
+ DoubleRoleAnnotationOnData.hs:6:1: error: [GHC-97170]
9
+ Duplicate role annotations for ‘Foo’:
10
+ type role Foo nominal
11
+ -- written at DoubleRoleAnnotationOnData.hs:5:1-21
12
+ type role Foo representational
13
+ -- written at DoubleRoleAnnotationOnData.hs:6:1-30
14
+ |
15
+ 6 | type role Foo representational
16
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17
+ ```
18
+
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Duplicate role annotations
3
+ summary : A type declaration has more than one accompanying role annotation
4
+ severity : error
5
+ introduced : 9.8.1
6
+ ---
7
+
8
+ This error occurs if more than one role annotation occurs for a given datatype.
9
+ Note that the role annotations need not be conflicting for this error to arise.
10
+ Also note that the role annotations can occur in different locations from the
11
+ datatype.
You can’t perform that action at this time.
0 commit comments