diff options
author | Roland Senn <rsx@bluewin.ch> | 2020-02-17 10:58:32 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-20 21:21:28 -0500 |
commit | 8b76d4574d703ee66f346775d408220fdddb8155 (patch) | |
tree | 2db0fd5588029d788dc36dba42ab97b9ed468e82 /testsuite/tests/rename/should_compile | |
parent | 65b7256a88ae2bd878da5d026e4183cba6f6eedf (diff) | |
download | haskell-8b76d4574d703ee66f346775d408220fdddb8155.tar.gz |
Fix #17832: Weird handling of exports named main in 8.10-rc1
Switching from `lookupGlobalOccRn_maybe` to `lookupInfoOccRn`
to check whether a `main` function is in scope. Unfortunately
`lookupGlobalOccRn_maybe` complains if there are multiple `main`
functions in scope.
Diffstat (limited to 'testsuite/tests/rename/should_compile')
4 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/T17832.stderr b/testsuite/tests/rename/should_compile/T17832.stderr new file mode 100644 index 0000000000..ecb2d5f33d --- /dev/null +++ b/testsuite/tests/rename/should_compile/T17832.stderr @@ -0,0 +1,2 @@ +[1 of 2] Compiling T17832M1 ( T17832M1.hs, T17832M1.o ) +[2 of 2] Compiling T17832M2 ( T17832M2.hs, T17832M2.o ) diff --git a/testsuite/tests/rename/should_compile/T17832M1.hs b/testsuite/tests/rename/should_compile/T17832M1.hs new file mode 100644 index 0000000000..6c864893c1 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T17832M1.hs @@ -0,0 +1,3 @@ +module T17832M1 (main) where +main :: IO () +main = return () diff --git a/testsuite/tests/rename/should_compile/T17832M2.hs b/testsuite/tests/rename/should_compile/T17832M2.hs new file mode 100644 index 0000000000..9fe7efef53 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T17832M2.hs @@ -0,0 +1,4 @@ +module T17832M2 (T17832M2.main) where +import T17832M1 +main :: IO () +main = putStrLn "M2" diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T index 4c295b20a3..6bcb9377bd 100644 --- a/testsuite/tests/rename/should_compile/all.T +++ b/testsuite/tests/rename/should_compile/all.T @@ -172,4 +172,5 @@ test('T15957', normal, compile, ['-Werror -Wredundant-record-wildcards -Wunused- test('T17244A', normal, compile, ['-Wno-error=compat-unqualified-imports']) test('T17244B', normal, compile, ['']) test('T17244C', normal, compile, ['']) +test('T17832', [], multimod_compile, ['T17832M1', 'T17832M2']) test('T17837', normal, compile, ['']) |