summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail
diff options
context:
space:
mode:
authorRoland Senn <rsx@bluewin.ch>2018-11-17 12:24:27 +0100
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-11-17 13:52:20 +0100
commit92f81841e885f081bbb079d0dca6eb50b9043d4b (patch)
tree57e370334d9c9b7220a402de89f73dfbd80ce357 /testsuite/tests/typecheck/should_fail
parent921fd890abe0e7267962c9439098b03c94ebdb9b (diff)
downloadhaskell-92f81841e885f081bbb079d0dca6eb50b9043d4b.tar.gz
Fix #12906: GHC fails to typecheck Main module without main
Summary: The function fail is no longer called immediately after adding the no-main error message to the TcM monad. The rest of the module will be typechecked. Test Plan: make test TEST=T12906 Reviewers: dfeuer, RyanGlScott, ezyang, mpickering, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #12906 Differential Revision: https://phabricator.haskell.org/D5338
Diffstat (limited to 'testsuite/tests/typecheck/should_fail')
-rw-r--r--testsuite/tests/typecheck/should_fail/T12906.hs5
-rw-r--r--testsuite/tests/typecheck/should_fail/T12906.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T4
3 files changed, 18 insertions, 1 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T12906.hs b/testsuite/tests/typecheck/should_fail/T12906.hs
new file mode 100644
index 0000000000..80a10f33f6
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12906.hs
@@ -0,0 +1,5 @@
+x :: String -> String
+x s = print (reverse s + 1)
+
+myshow :: (String -> String) -> String
+myshow x = show x
diff --git a/testsuite/tests/typecheck/should_fail/T12906.stderr b/testsuite/tests/typecheck/should_fail/T12906.stderr
new file mode 100644
index 0000000000..c74fd97bbc
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12906.stderr
@@ -0,0 +1,10 @@
+
+T12906.hs:1:1: error:
+ The IO action ‘main’ is not defined in module ‘Main’
+
+T12906.hs:2:7: error:
+ • Couldn't match type ‘IO ()’ with ‘[Char]’
+ Expected type: String
+ Actual type: IO ()
+ • In the expression: print (reverse s + 1)
+ In an equation for ‘x’: x s = print (reverse s + 1)
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index c3a9f510d0..3805315398 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -141,7 +141,8 @@ test('tcfail154', normal, compile_fail, [''])
test('tcfail155', normal, compile_fail, [''])
test('tcfail156', normal, compile_fail, [''])
test('tcfail157', normal, compile_fail, [''])
-test('tcfail158', normal, compile_fail, [''])
+# Skip tcfail158 until Trac ticket #15899 fixes the broken test
+test('tcfail158', skip, compile_fail, [''])
test('tcfail159', normal, compile_fail, [''])
test('tcfail160', normal, compile_fail, [''])
test('tcfail161', normal, compile_fail, [''])
@@ -424,6 +425,7 @@ test('T12803', normal, compile_fail, [''])
test('T12042', [extra_files(['T12042.hs', 'T12042a.hs', 'T12042.hs-boot'])], multimod_compile_fail, ['T12042', ''])
test('T12966', normal, compile_fail, [''])
test('T12837', normal, compile_fail, [''])
+test('T12906', normal, compile_fail, [''])
test('T12918a', normal, compile_fail, [''])
test('T12918b', normal, compile_fail, [''])
test('T12921', normal, compile_fail, [''])