summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_compile/Makefile6
-rw-r--r--testsuite/tests/typecheck/should_compile/Tc271.hs10
-rw-r--r--testsuite/tests/typecheck/should_compile/Tc271.hs-boot5
-rw-r--r--testsuite/tests/typecheck/should_compile/Tc271a.hs5
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
5 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/Makefile b/testsuite/tests/typecheck/should_compile/Makefile
index 7af8ae146d..cb8269ae15 100644
--- a/testsuite/tests/typecheck/should_compile/Makefile
+++ b/testsuite/tests/typecheck/should_compile/Makefile
@@ -50,3 +50,9 @@ Tc267:
'$(TEST_HC)' $(TEST_HC_OPTS) -c Tc267b.hs-boot
'$(TEST_HC)' $(TEST_HC_OPTS) -c Tc267a.hs
'$(TEST_HC)' $(TEST_HC_OPTS) -c Tc267b.hs
+
+Tc271:
+ $(RM) -f Tc271.hi-boot Tc271.o-boot Tc271a.hi Tc271a.o Tc271.hi Tc271.o
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c Tc271.hs-boot
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c Tc271a.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c Tc271.hs
diff --git a/testsuite/tests/typecheck/should_compile/Tc271.hs b/testsuite/tests/typecheck/should_compile/Tc271.hs
new file mode 100644
index 0000000000..5f0c3f0a1a
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/Tc271.hs
@@ -0,0 +1,10 @@
+module Tc271 where
+
+import Tc271a
+
+class K a where
+ f :: a -> a
+ g :: a -> a
+
+h :: K a => a -> a
+h = f . g . h2
diff --git a/testsuite/tests/typecheck/should_compile/Tc271.hs-boot b/testsuite/tests/typecheck/should_compile/Tc271.hs-boot
new file mode 100644
index 0000000000..9f15065a11
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/Tc271.hs-boot
@@ -0,0 +1,5 @@
+module Tc271 where
+
+class K a where
+
+h :: K a => a -> a
diff --git a/testsuite/tests/typecheck/should_compile/Tc271a.hs b/testsuite/tests/typecheck/should_compile/Tc271a.hs
new file mode 100644
index 0000000000..b5fd136599
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/Tc271a.hs
@@ -0,0 +1,5 @@
+module Tc271a where
+import {-# SOURCE #-} Tc271
+
+h2 :: K a => a -> a
+h2 = h
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index e9aacd8678..837a0d7995 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -343,6 +343,7 @@ test('Tc267', [extra_files(['Tc267a.hs', 'Tc267b.hs', 'Tc267a.hs-boot', 'Tc267b.
test('tc268', normal, compile, [''])
test('tc269', normal, compile, [''])
test('tc270', normal, compile, [''])
+test('Tc271', [extra_files(['Tc271a.hs', 'Tc271.hs', 'Tc271.hs-boot'])], run_command, ['$MAKE -s --no-print-directory Tc271'])
test('GivenOverlapping', normal, compile, [''])
test('GivenTypeSynonym', normal, compile, [''])