diff options
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/simpl010.hs')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/simpl010.hs | 19 |
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 |