diff options
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/T3208b.hs')
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T3208b.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T3208b.hs b/testsuite/tests/indexed-types/should_compile/T3208b.hs new file mode 100644 index 0000000000..012756abd1 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T3208b.hs @@ -0,0 +1,22 @@ +{-# LANGUAGE TypeFamilies #-} + +-- This should fail + +module T3208b where + +class SUBST s where + type STerm s + +class OBJECT o where + type OTerm o + apply :: (SUBST s, OTerm o ~ STerm s) => s -> o + +fce' :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a -> c +fce' f = fce (apply f) +-- f :: a +-- apply f :: (OBJECT a, SUBST a, OTerm o ~ STerm a) => o +-- fce called with a=o, gives wanted (OTerm o ~ STerm o, OBJECT o, SUBST o) + + +fce :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a -> c +fce f = fce' f |