Commit 0cb72d03 authored by simonpj's avatar simonpj

[project @ 2004-10-04 15:44:08 by simonpj]

Add a GADT test
parent ab63bd00
......@@ -10,3 +10,4 @@ test('simpl005', normal, compile, [''])
test('simpl007', normal, compile, [''])
test('simpl008', normal, compile_fail, [''])
test('simpl009', normal, compile, [''])
test('simpl010', normal, compile, [''])
{-# OPTIONS -fglasgow-exts #-}
-- 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment