summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/deriving/should_fail/T1496.stderr3
-rw-r--r--testsuite/tests/deriving/should_fail/T2721.stderr2
-rw-r--r--testsuite/tests/deriving/should_fail/T4846.stderr2
-rw-r--r--testsuite/tests/deriving/should_fail/T7148.stderr5
-rw-r--r--testsuite/tests/deriving/should_fail/T7148a.stderr3
-rw-r--r--testsuite/tests/gadt/CasePrune.stderr2
-rw-r--r--testsuite/tests/roles/should_compile/RolesIArray.hs10
-rw-r--r--testsuite/tests/roles/should_compile/all.T1
-rw-r--r--testsuite/tests/roles/should_fail/Roles10.stderr2
-rw-r--r--testsuite/tests/roles/should_fail/Roles9.hs13
-rw-r--r--testsuite/tests/roles/should_fail/all.T1
11 files changed, 23 insertions, 21 deletions
diff --git a/testsuite/tests/deriving/should_fail/T1496.stderr b/testsuite/tests/deriving/should_fail/T1496.stderr
index cc4cdc2760..b24ef69a7c 100644
--- a/testsuite/tests/deriving/should_fail/T1496.stderr
+++ b/testsuite/tests/deriving/should_fail/T1496.stderr
@@ -3,5 +3,6 @@ T1496.hs:10:32:
Can't make a derived instance of ‛IsInt Moo’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
- the last parameter of ‛IsInt’ is at role Nominal
+ ‛isInt’, at type ‛forall (c :: * -> *).
+ c Int -> c t’, cannot be converted safely
In the newtype declaration for ‛Moo’
diff --git a/testsuite/tests/deriving/should_fail/T2721.stderr b/testsuite/tests/deriving/should_fail/T2721.stderr
index 710b933637..0e5d764488 100644
--- a/testsuite/tests/deriving/should_fail/T2721.stderr
+++ b/testsuite/tests/deriving/should_fail/T2721.stderr
@@ -4,5 +4,5 @@ T2721.hs:15:28:
(even with cunning newtype deriving):
the class has associated types
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
- the last parameter of ‛C’ is at role Nominal
+ ‛foo’, at type ‛a -> T a’, cannot be converted safely
In the newtype declaration for ‛N’
diff --git a/testsuite/tests/deriving/should_fail/T4846.stderr b/testsuite/tests/deriving/should_fail/T4846.stderr
index beb765375a..0edb2083cd 100644
--- a/testsuite/tests/deriving/should_fail/T4846.stderr
+++ b/testsuite/tests/deriving/should_fail/T4846.stderr
@@ -3,5 +3,5 @@ T4846.hs:29:1:
Can't make a derived instance of ‛B BOOL’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
- the last parameter of ‛B’ is at role Nominal
+ ‛mkExpr’, at type ‛Expr a’, cannot be converted safely
In the stand-alone deriving instance for ‛B BOOL’
diff --git a/testsuite/tests/deriving/should_fail/T7148.stderr b/testsuite/tests/deriving/should_fail/T7148.stderr
index 748ef08c68..a57dbef8ce 100644
--- a/testsuite/tests/deriving/should_fail/T7148.stderr
+++ b/testsuite/tests/deriving/should_fail/T7148.stderr
@@ -3,5 +3,8 @@ T7148.hs:27:40:
Can't make a derived instance of ‛IsoUnit (Tagged a b)’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
- the last parameter of ‛IsoUnit’ is at role Nominal
+ ‛iso1’, at type ‛forall b.
+ SameType () b -> SameType a b’, cannot be converted safely
+ ‛iso2’, at type ‛forall b.
+ SameType b () -> SameType b a’, cannot be converted safely
In the newtype declaration for ‛Tagged’
diff --git a/testsuite/tests/deriving/should_fail/T7148a.stderr b/testsuite/tests/deriving/should_fail/T7148a.stderr
index fa4a2dcb7b..00f875d30c 100644
--- a/testsuite/tests/deriving/should_fail/T7148a.stderr
+++ b/testsuite/tests/deriving/should_fail/T7148a.stderr
@@ -3,5 +3,6 @@ T7148a.hs:19:50:
Can't make a derived instance of ‛Convert (IS_NO_LONGER a)’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
- the last parameter of ‛Convert’ is at role Nominal
+ ‛coerce’, at type ‛forall b.
+ Proxy b -> a -> Result a b’, cannot be converted safely
In the newtype declaration for ‛IS_NO_LONGER’
diff --git a/testsuite/tests/gadt/CasePrune.stderr b/testsuite/tests/gadt/CasePrune.stderr
index d3dbc6ea3c..d763e0bd17 100644
--- a/testsuite/tests/gadt/CasePrune.stderr
+++ b/testsuite/tests/gadt/CasePrune.stderr
@@ -3,5 +3,5 @@ CasePrune.hs:14:31:
Can't make a derived instance of ‛C A’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
- the last parameter of ‛C’ is at role Nominal
+ ‛ic’, at type ‛T a’, cannot be converted safely
In the newtype declaration for ‛A’
diff --git a/testsuite/tests/roles/should_compile/RolesIArray.hs b/testsuite/tests/roles/should_compile/RolesIArray.hs
new file mode 100644
index 0000000000..a79909d827
--- /dev/null
+++ b/testsuite/tests/roles/should_compile/RolesIArray.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+
+module RolesIArray where
+
+import Data.Word
+import Data.Array.IArray
+import Data.Array.Unboxed
+
+newtype N = MkN Word64
+ deriving (IArray UArray) \ No newline at end of file
diff --git a/testsuite/tests/roles/should_compile/all.T b/testsuite/tests/roles/should_compile/all.T
index eaa398d619..266a260f09 100644
--- a/testsuite/tests/roles/should_compile/all.T
+++ b/testsuite/tests/roles/should_compile/all.T
@@ -3,3 +3,4 @@ test('Roles2', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles3', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles4', only_ways('normal'), compile, ['-ddump-tc'])
test('Roles13', only_ways('normal'), compile, ['-ddump-simpl -dsuppress-uniques'])
+test('RolesIArray', only_ways('normal'), compile, ['']) \ No newline at end of file
diff --git a/testsuite/tests/roles/should_fail/Roles10.stderr b/testsuite/tests/roles/should_fail/Roles10.stderr
index 756aaa2e00..76c0c0d63d 100644
--- a/testsuite/tests/roles/should_fail/Roles10.stderr
+++ b/testsuite/tests/roles/should_fail/Roles10.stderr
@@ -3,5 +3,5 @@ Roles10.hs:16:12:
Can't make a derived instance of ‛C Age’
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
- the last parameter of ‛C’ is at role Nominal
+ ‛meth’, at type ‛a -> F a’, cannot be converted safely
In the newtype declaration for ‛Age’
diff --git a/testsuite/tests/roles/should_fail/Roles9.hs b/testsuite/tests/roles/should_fail/Roles9.hs
deleted file mode 100644
index f8e134d5a1..0000000000
--- a/testsuite/tests/roles/should_fail/Roles9.hs
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, RoleAnnotations #-}
-
-module Roles9 where
-
-type role C nominal
-class C a where
- meth :: a -> a
-
-instance C Int where
- meth = (+ 1)
-
-newtype Age = MkAge Int
- deriving C
diff --git a/testsuite/tests/roles/should_fail/all.T b/testsuite/tests/roles/should_fail/all.T
index 36f2d2e1a4..0e30472b09 100644
--- a/testsuite/tests/roles/should_fail/all.T
+++ b/testsuite/tests/roles/should_fail/all.T
@@ -2,7 +2,6 @@ test('Roles5', normal, compile_fail, [''])
test('Roles6', normal, compile_fail, [''])
test('Roles7', normal, compile_fail, [''])
test('Roles8', normal, compile_fail, [''])
-test('Roles9', normal, compile_fail, [''])
test('Roles10', normal, compile_fail, [''])
test('Roles11', normal, compile_fail, [''])
test('Roles12',