diff --git a/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/after/DoubleRoleAnnotationOnData.hs b/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/after/DoubleRoleAnnotationOnData.hs new file mode 100644 index 00000000..93147261 --- /dev/null +++ b/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/after/DoubleRoleAnnotationOnData.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE RoleAnnotations #-} +module DoubleRoleAnnotationOnData where + +data Foo a = MkFoo a +type role Foo nominal diff --git a/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/before/DoubleRoleAnnotationOnData.hs b/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/before/DoubleRoleAnnotationOnData.hs new file mode 100644 index 00000000..0515d77f --- /dev/null +++ b/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/before/DoubleRoleAnnotationOnData.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE RoleAnnotations #-} +module DoubleRoleAnnotationOnData where + +data Foo a = MkFoo a +type role Foo nominal +type role Foo representational diff --git a/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/index.md b/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/index.md new file mode 100644 index 00000000..d2e1474e --- /dev/null +++ b/message-index/messages/GHC-97170/doubleRoleAnnotationOnData/index.md @@ -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 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``` + diff --git a/message-index/messages/GHC-97170/index.md b/message-index/messages/GHC-97170/index.md new file mode 100644 index 00000000..82296e93 --- /dev/null +++ b/message-index/messages/GHC-97170/index.md @@ -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.