summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail174.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail174.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail174.hs b/testsuite/tests/typecheck/should_fail/tcfail174.hs
new file mode 100644
index 0000000000..47c63d7248
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.hs
@@ -0,0 +1,17 @@
+{-# OPTIONS -XImpredicativeTypes #-}
+
+module Foo where
+
+data Capture a = Base a
+ | Capture (Capture (forall x . x -> a))
+
+g :: Capture (forall a . a -> a)
+g = Base id -- Fails; need a rigid signature on 'id'
+
+-- This function should definitely be rejected, with or without type signature
+
+h1 = Capture g
+
+h2 :: Capture b
+h2 = Capture g
+