[commit: testsuite] master: Update tests to reflect new check for GeneralizedNewtypeDeriving (88ef0f8)

git at git.haskell.org git at git.haskell.org
Wed Oct 23 13:28:33 UTC 2013


Repository : ssh://git@git.haskell.org/testsuite

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/88ef0f85f74d53a5f6f718866ed3ad91ee38c7df/testsuite

>---------------------------------------------------------------

commit 88ef0f85f74d53a5f6f718866ed3ad91ee38c7df
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Mon Oct 21 13:04:47 2013 -0400

    Update tests to reflect new check for GeneralizedNewtypeDeriving


>---------------------------------------------------------------

88ef0f85f74d53a5f6f718866ed3ad91ee38c7df
 tests/deriving/should_fail/T1496.stderr   |    3 ++-
 tests/deriving/should_fail/T2721.stderr   |    2 +-
 tests/deriving/should_fail/T4846.stderr   |    2 +-
 tests/deriving/should_fail/T7148.stderr   |    5 ++++-
 tests/deriving/should_fail/T7148a.stderr  |    3 ++-
 tests/gadt/CasePrune.stderr               |    2 +-
 tests/roles/should_compile/RolesIArray.hs |   10 ++++++++++
 tests/roles/should_compile/all.T          |    1 +
 tests/roles/should_fail/Roles10.stderr    |    2 +-
 tests/roles/should_fail/Roles9.hs         |   13 -------------
 tests/roles/should_fail/all.T             |    1 -
 11 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/tests/deriving/should_fail/T1496.stderr b/tests/deriving/should_fail/T1496.stderr
index cc4cdc2..b24ef69 100644
--- a/tests/deriving/should_fail/T1496.stderr
+++ b/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/tests/deriving/should_fail/T2721.stderr b/tests/deriving/should_fail/T2721.stderr
index 710b933..0e5d764 100644
--- a/tests/deriving/should_fail/T2721.stderr
+++ b/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/tests/deriving/should_fail/T4846.stderr b/tests/deriving/should_fail/T4846.stderr
index beb7653..0edb208 100644
--- a/tests/deriving/should_fail/T4846.stderr
+++ b/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/tests/deriving/should_fail/T7148.stderr b/tests/deriving/should_fail/T7148.stderr
index 748ef08..a57dbef 100644
--- a/tests/deriving/should_fail/T7148.stderr
+++ b/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/tests/deriving/should_fail/T7148a.stderr b/tests/deriving/should_fail/T7148a.stderr
index fa4a2dc..00f875d 100644
--- a/tests/deriving/should_fail/T7148a.stderr
+++ b/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/tests/gadt/CasePrune.stderr b/tests/gadt/CasePrune.stderr
index d3dbc6e..d763e0b 100644
--- a/tests/gadt/CasePrune.stderr
+++ b/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/tests/roles/should_compile/RolesIArray.hs b/tests/roles/should_compile/RolesIArray.hs
new file mode 100644
index 0000000..a79909d
--- /dev/null
+++ b/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/tests/roles/should_compile/all.T b/tests/roles/should_compile/all.T
index eaa398d..266a260 100644
--- a/tests/roles/should_compile/all.T
+++ b/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/tests/roles/should_fail/Roles10.stderr b/tests/roles/should_fail/Roles10.stderr
index 756aaa2..76c0c0d 100644
--- a/tests/roles/should_fail/Roles10.stderr
+++ b/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/tests/roles/should_fail/Roles9.hs b/tests/roles/should_fail/Roles9.hs
deleted file mode 100644
index f8e134d..0000000
--- a/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/tests/roles/should_fail/all.T b/tests/roles/should_fail/all.T
index 36f2d2e..0e30472 100644
--- a/tests/roles/should_fail/all.T
+++ b/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',



More information about the ghc-commits mailing list