diff options
author | David Terei <davidterei@gmail.com> | 2011-07-20 11:09:03 -0700 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-07-20 11:26:35 -0700 |
commit | 16514f272fb42af6e9c7674a9bd6c9dce369231f (patch) | |
tree | e4f332b45fe65e2a7a2451be5674f887b42bf199 /testsuite/tests/indexed-types/should_fail/T4254.hs | |
parent | ebd422aed41048476aa61dd4c520d43becd78682 (diff) | |
download | haskell-16514f272fb42af6e9c7674a9bd6c9dce369231f.tar.gz |
Move tests from tests/ghc-regress/* to just tests/*
Diffstat (limited to 'testsuite/tests/indexed-types/should_fail/T4254.hs')
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/T4254.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/T4254.hs b/testsuite/tests/indexed-types/should_fail/T4254.hs new file mode 100644 index 0000000000..b12ffb4f87 --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/T4254.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE TypeFamilies, FunctionalDependencies, RankNTypes, MultiParamTypeClasses #-} +module T4254 where + +class FD a b | a -> b where + op :: a -> b; + op = undefined + +instance FD Int Bool + +ok1 :: forall a b. (a~Int,FD a b) => a -> b +ok1 = op +-- Should be OK: op has the right type + +ok2 :: forall a b. (a~Int,FD a b,b~Bool) => a -> Bool +ok2 = op +-- Should be OK: needs the b~Bool + +fails :: forall a b. (a~Int,FD a b) => a -> Bool +fails = op +-- Could fail: no proof that b~Bool +-- But can also succeed; it's not a *wanted* constraint |