summaryrefslogtreecommitdiff
path: root/testsuite/tests/pmcheck/should_compile/T12949.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/pmcheck/should_compile/T12949.hs')
-rw-r--r--testsuite/tests/pmcheck/should_compile/T12949.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T12949.hs b/testsuite/tests/pmcheck/should_compile/T12949.hs
new file mode 100644
index 0000000000..90fe024067
--- /dev/null
+++ b/testsuite/tests/pmcheck/should_compile/T12949.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+module T12949 where
+
+class Foo a where
+ foo :: Maybe a
+
+data Result a b = Neither | This a | That b | Both a b
+
+q :: forall a b . (Foo a, Foo b) => Result a b
+q = case foo :: Maybe a of
+ Nothing -> case foo :: Maybe b of
+ Nothing -> Neither
+ Just c -> That c
+ Just i -> case foo :: Maybe b of
+ Nothing -> This i
+ Just c -> Both i c