summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc207.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/tc207.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/tc207.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc207.hs b/testsuite/tests/typecheck/should_compile/tc207.hs
new file mode 100644
index 0000000000..a5b952176b
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc207.hs
@@ -0,0 +1,16 @@
+
+-- Tests enhanced polymorphism
+
+module ShouldCompile where
+
+foo xs = let
+ f :: Eq a => [a] -> [a]
+ f [] = []
+ f xs | null (g [True]) = []
+ | otherwise = tail (g xs)
+
+ g :: Eq b => [b] -> [b]
+ g [] = []
+ g xs | null (f "hello") = []
+ | otherwise = tail (f xs)
+ in f xs