summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T18406.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T18406.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/T18406.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T18406.hs b/testsuite/tests/typecheck/should_fail/T18406.hs
new file mode 100644
index 0000000000..7ebcc278fc
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T18406.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts #-}
+
+module Bug where
+
+class C a b | a -> b where
+ op :: a -> b -> ()
+
+f x = op True x
+
+{- We could accept this, quantifying over a C Bool b constraint. But this is a
+bit silly, actually, because the b is fixed by the fundep. We don't know what
+it's fix to, but it's definitely fixed. So, in the end, we choose not to
+Henry Ford polymorphism ("it works for any b as long as b is ???") and not
+to quantify. Users can quantify manually if they want.
+-}