summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/simpl010.hs
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2011-07-20 11:09:03 -0700
committerDavid Terei <davidterei@gmail.com>2011-07-20 11:26:35 -0700
commit16514f272fb42af6e9c7674a9bd6c9dce369231f (patch)
treee4f332b45fe65e2a7a2451be5674f887b42bf199 /testsuite/tests/simplCore/should_compile/simpl010.hs
parentebd422aed41048476aa61dd4c520d43becd78682 (diff)
downloadhaskell-16514f272fb42af6e9c7674a9bd6c9dce369231f.tar.gz
Move tests from tests/ghc-regress/* to just tests/*
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/simpl010.hs')
-rw-r--r--testsuite/tests/simplCore/should_compile/simpl010.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/simpl010.hs b/testsuite/tests/simplCore/should_compile/simpl010.hs
new file mode 100644
index 0000000000..da2af345f2
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/simpl010.hs
@@ -0,0 +1,19 @@
+
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- This tests an interaction between GADTs and join points
+-- The case-of-case transformation can pretty easily result
+-- in a type mis-match, because the join point does not see
+-- the refinement from the case branch
+
+module ShouldCompile( h ) where
+
+data T a = forall b. T b [a] | T2
+
+f :: a -> T a -> [a]
+f x (T _ a) = a ++ a ++ a ++ [x]
+f x T2 = [x]
+
+h :: a -> Bool -> T a -> T a -> [a]
+h x b p q = f x (case b of { True -> p; False -> q })
+ \ No newline at end of file