[commit: ghc] wip/rae-new-coercible: Test #8984 in deriving/should_fail/T8984 (fc853b9)
git at git.haskell.org
git at git.haskell.org
Tue Dec 2 20:44:28 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/rae-new-coercible
Link : http://ghc.haskell.org/trac/ghc/changeset/fc853b9efaab02a61087b7b97caca8f1ada5bed7/ghc
>---------------------------------------------------------------
commit fc853b9efaab02a61087b7b97caca8f1ada5bed7
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date: Tue Dec 2 15:24:27 2014 -0500
Test #8984 in deriving/should_fail/T8984
>---------------------------------------------------------------
fc853b9efaab02a61087b7b97caca8f1ada5bed7
testsuite/tests/deriving/should_fail/T8984.hs | 8 ++++++++
testsuite/tests/deriving/should_fail/T8984.stderr | 11 +++++++++++
testsuite/tests/deriving/should_fail/all.T | 1 +
3 files changed, 20 insertions(+)
diff --git a/testsuite/tests/deriving/should_fail/T8984.hs b/testsuite/tests/deriving/should_fail/T8984.hs
new file mode 100644
index 0000000..6b0b395
--- /dev/null
+++ b/testsuite/tests/deriving/should_fail/T8984.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE ConstraintKinds, GeneralizedNewtypeDeriving #-}
+module T8984 where
+
+class C a where
+ app :: a (a Int)
+
+newtype N cat a b = MkN (cat a b) deriving( C )
+-- The newtype coercion is N cat ~R cat
diff --git a/testsuite/tests/deriving/should_fail/T8984.stderr b/testsuite/tests/deriving/should_fail/T8984.stderr
new file mode 100644
index 0000000..6606d66
--- /dev/null
+++ b/testsuite/tests/deriving/should_fail/T8984.stderr
@@ -0,0 +1,11 @@
+
+T8984.hs:7:46:
+ Couldn't match representation of type ‘cat a (N cat a Int)’
+ with that of ‘cat a (cat a Int)’
+ arising from the coercion of the method ‘app’
+ from type ‘cat a (cat a Int)’ to type ‘N cat a (N cat a Int)’
+ Relevant role signatures:
+ type role N representational nominal nominal
+ NB: We cannot know what roles the parameters to ‘cat a’ have;
+ we must assume that the role is nominal
+ When deriving the instance for (C (N cat a))
diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T
index 54a6f95..df7957d 100644
--- a/testsuite/tests/deriving/should_fail/all.T
+++ b/testsuite/tests/deriving/should_fail/all.T
@@ -53,3 +53,4 @@ test('T9071', normal, multimod_compile_fail, ['T9071',''])
test('T9071_2', normal, compile_fail, [''])
test('T9687', normal, compile_fail, [''])
+test('T8984', normal, compile_fail, [''])
More information about the ghc-commits
mailing list