summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T7453.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-11-28 02:40:18 +0000
committerIan Lynagh <ian@well-typed.com>2012-11-28 02:40:18 +0000
commit31e246dfdfb0aea3768617cb5baba57d568497e7 (patch)
treee29f3733d555e2ac4a4bdd179a5c46cbc112ba32 /testsuite/tests/typecheck/should_fail/T7453.hs
parent5689e2dc6d948eb955dd380e8c0285aa66026e13 (diff)
downloadhaskell-31e246dfdfb0aea3768617cb5baba57d568497e7.tar.gz
Add a test for #7453
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T7453.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/T7453.hs32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T7453.hs b/testsuite/tests/typecheck/should_fail/T7453.hs
new file mode 100644
index 0000000000..b79ac9a0b9
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T7453.hs
@@ -0,0 +1,32 @@
+
+module T7453 where
+
+newtype Id a = Id { runId :: a }
+
+-- cast1 :: a -> b
+cast1 v = runId z
+ where z :: Id t
+ z = aux
+ where aux = Id v
+
+-- cast2 :: a -> b
+cast2 v = z ()
+ where z :: () -> t
+ z = aux
+ where aux = const v
+
+-- cast3 :: a -> b
+cast3 v = z
+ where z :: t
+ z = v
+ where aux = const v
+
+cast1' :: a -> b
+cast1' = cast1
+
+cast2' :: a -> b
+cast2' = cast2
+
+cast3' :: a -> b
+cast3' = cast3
+