summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc117.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/tc117.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/tc117.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc117.hs b/testsuite/tests/typecheck/should_compile/tc117.hs
new file mode 100644
index 0000000000..d27c2b0076
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc117.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
+ FlexibleInstances, UndecidableInstances #-}
+-- UndecidableInstances now needed because the Coverage Condition fails
+
+-- !!! Functional dependencies
+-- This one gave another fail in tcReadMutVar
+
+module M1 where
+
+class HasFoo a foo | a -> foo where
+ foo :: a -> foo
+instance HasFoo Int Int where
+ foo = id
+
+instance HasFoo a b => HasFoo [a] b where
+ foo = foo . head
+
+test:: [[Int]] -> Int
+test = foo