diff options
Diffstat (limited to 'testsuite/tests/typecheck/should_run/tcrun029.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_run/tcrun029.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/tcrun029.hs b/testsuite/tests/typecheck/should_run/tcrun029.hs new file mode 100644 index 0000000000..55071be483 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/tcrun029.hs @@ -0,0 +1,29 @@ +{-# LANGUAGE DatatypeContexts #-} +-- Killed GHC 5.02.3 + +-- Confusion about whether the wrapper for a data constructor +-- with a "stupid context" includes the stupid context or not +-- Core lint catches it, but it seg-faults if it runs + +module Main where + +data Color = Red + | Black + deriving Show + +data Ord k => Tree k d = None + | Node{color::Color, + key::k, + item::d, + left::(Tree k d), + right::(Tree k d)} + deriving Show + +insert k i t = (insert2 t) {color=Black} + where insert2 None = Node{color=Red, + key=k, + item=i, + left=None, + right=None} + +main = print (insert 1 2 None)
\ No newline at end of file |