summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T4254b.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/indexed-types/should_fail/T4254b.hs')
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4254b.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/T4254b.hs b/testsuite/tests/indexed-types/should_fail/T4254b.hs
new file mode 100644
index 0000000000..ffd117bc4c
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_fail/T4254b.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE TypeFamilies, FunctionalDependencies, RankNTypes, MultiParamTypeClasses #-}
+module T4254b where
+
+class FD a b | a -> b where
+ op :: a -> b;
+ op = undefined
+
+instance FD Int 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