summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/GivenOverlapping.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/GivenOverlapping.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/GivenOverlapping.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/GivenOverlapping.hs b/testsuite/tests/typecheck/should_compile/GivenOverlapping.hs
new file mode 100644
index 0000000000..35f4b07962
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/GivenOverlapping.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE FunctionalDependencies, FlexibleContexts #-}
+
+class C a where
+
+class D a where
+ dop :: a -> a
+
+instance C a => D [a] where
+ dop = undefined
+
+class J a b | a -> b
+ where j :: a -> b -> ()
+
+instance J Bool Int where
+ j = undefined
+
+foo :: D [Int] => ()
+foo = j True (head (dop [undefined]))
+
+main = return ()
+