summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/typecheck/should_run/T7861.hs13
-rw-r--r--testsuite/tests/typecheck/should_run/T7861.stderr1
-rw-r--r--testsuite/tests/typecheck/should_run/T7861.stdout1
-rwxr-xr-xtestsuite/tests/typecheck/should_run/all.T1
4 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/T7861.hs b/testsuite/tests/typecheck/should_run/T7861.hs
new file mode 100644
index 0000000000..1f2066c1e1
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/T7861.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE RankNTypes #-}
+{-# OPTIONS_GHC -fdefer-type-errors #-}
+module Main where
+
+type A a = forall b. a
+
+doA :: A a -> [a]
+doA = undefined
+
+f :: A a -> a
+f = doA
+
+main = do { print "Hello"; f `seq` print "Bad" }
diff --git a/testsuite/tests/typecheck/should_run/T7861.stderr b/testsuite/tests/typecheck/should_run/T7861.stderr
new file mode 100644
index 0000000000..0519ecba6e
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/T7861.stderr
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/testsuite/tests/typecheck/should_run/T7861.stdout b/testsuite/tests/typecheck/should_run/T7861.stdout
new file mode 100644
index 0000000000..4b849dbdb3
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/T7861.stdout
@@ -0,0 +1 @@
+"Hello"
diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T
index 55d88ec963..1d714a2757 100755
--- a/testsuite/tests/typecheck/should_run/all.T
+++ b/testsuite/tests/typecheck/should_run/all.T
@@ -109,3 +109,4 @@ test('T5751', normal, compile_and_run, [''])
test('T5913', normal, compile_and_run, [''])
test('T7748', normal, compile_and_run, [''])
test('TcNullaryTC', when(compiler_lt('ghc', '7.7'), skip), compile_and_run, [''])
+test('T7861', exit_code(1), compile_and_run, [''])