summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc140.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/tc140.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/tc140.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc140.hs b/testsuite/tests/typecheck/should_compile/tc140.hs
new file mode 100644
index 0000000000..6536e3d47d
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc140.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Rank2Types #-}
+
+-- Make sure for-alls can occur in data types
+
+module Foo where
+
+newtype CPS1 a = CPS1 { unCPS1 :: forall ans . (a -> ans) -> ans }
+
+newtype CPS2 a = CPS2 (forall ans . (a -> ans) -> ans)
+ -- This one also has an interesting record selector;
+ -- caused an applyTypeArgs crash in 5.02.1
+
+data CPS3 a = CPS3 { unCPS3 :: forall ans . (a -> ans) -> ans }
+data CPS4 a = CPS4 (forall ans . (a -> ans) -> ans)