summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/FD1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/FD1.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/FD1.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/FD1.hs b/testsuite/tests/typecheck/should_compile/FD1.hs
new file mode 100644
index 0000000000..0c8942ad95
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/FD1.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
+{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
+
+-- Trac #1781
+-- This one should really succeed, because 'plus' can only
+-- be called with a = Int->Int, but the old fundep story
+-- certainly made it fail, and so that's what we expect for now
+-- We may become more liberal later
+
+module ShouldCompile where
+
+class E a b | a -> b, b -> a
+instance E a a
+
+plus :: (E a (Int -> Int)) => Int -> a
+plus x y = x + y
+