From 16514f272fb42af6e9c7674a9bd6c9dce369231f Mon Sep 17 00:00:00 2001 From: David Terei Date: Wed, 20 Jul 2011 11:09:03 -0700 Subject: Move tests from tests/ghc-regress/* to just tests/* --- testsuite/tests/gadt/CasePrune.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 testsuite/tests/gadt/CasePrune.hs (limited to 'testsuite/tests/gadt/CasePrune.hs') diff --git a/testsuite/tests/gadt/CasePrune.hs b/testsuite/tests/gadt/CasePrune.hs new file mode 100644 index 0000000000..4048c94c5f --- /dev/null +++ b/testsuite/tests/gadt/CasePrune.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving #-} + +-- See Trac #1251 and the comments +-- Note [Pruning dead case alternatives] in types/Unify.lhs + +module Main( main ) where + +data T a where MkT :: T Int + +class C a where ic :: T a + +instance C Int where ic = MkT + +newtype A = MkA Int deriving( C ) + +-- axiom CoA : A ~ Int +-- Hence C Int ~ C A + +-- instance C A where +-- ic :: T A +-- ic = MkT + +icA = ic :: T A -- There are no (non-bot) values of this type + +main = print (icA `seq` "ok") + + + -- cgit v1.2.1