summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.hs
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2013-11-19 12:01:27 +0000
committerJoachim Breitner <mail@joachim-breitner.de>2013-11-19 12:01:27 +0000
commita37c6ad604e28c4f554e342ef8b967a2650829f9 (patch)
treed4eaa30a2db74cd2b2f1319f7093589f7b750523 /testsuite/tests/typecheck/should_fail/TcCoercibleFail3.hs
parent483ff505b7e1616680b8e8605292ae160a6ff77d (diff)
downloadhaskell-a37c6ad604e28c4f554e342ef8b967a2650829f9.tar.gz
Test case for undersaturated newtype in Coercions
This is related to #8541.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/TcCoercibleFail3.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail3.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.hs b/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.hs
new file mode 100644
index 0000000000..4caf1c2632
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail3.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE RoleAnnotations, RankNTypes, ScopedTypeVariables #-}
+
+import GHC.Prim (coerce, Coercible)
+
+newtype List a = List [a]
+data T f = T (f Int)
+
+newtype NT1 a = NT1 (a -> Int)
+newtype NT2 a = NT2 (a -> Int)
+
+foo :: T NT1 -> T NT2
+foo = coerce
+
+main = return ()