summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T18802.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T18802.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/T18802.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T18802.hs b/testsuite/tests/typecheck/should_compile/T18802.hs
new file mode 100644
index 0000000000..df306c6c25
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T18802.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE MonoLocalBinds, ScopedTypeVariables, RankNTypes #-}
+
+module T18802 where
+
+-- Check that we handle higher-rank types properly.
+data R b = MkR { f :: (forall a. a -> a) -> (Int,b), c :: Int }
+
+foo r = r { f = \ k -> (k 3, k 'x') }
+
+
+-- Check that we handle existentials properly.
+class C a where
+
+data D
+ = forall ty. C ty
+ => MkD { fld1 :: !ty
+ , fld2 :: Bool
+ }
+
+g :: D -> D
+g d = d { fld2 = False }