summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2023-04-29 01:48:33 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-03 20:18:16 -0400
commit4eafb52a26ad07b2be0af71a6896fb01ed919614 (patch)
treecf40b0a6cb0397b58acb2c545d621d9860400052 /testsuite
parent1e9caa1a54e149a71af2555336531425f64521af (diff)
downloadhaskell-4eafb52a26ad07b2be0af71a6896fb01ed919614.tar.gz
Don't forget to check the parent in an export list
Commit 3f374399 introduced a bug which caused us to forget to include the parent of an export item of the form T(..) (that is, IEThingAll) when checking for duplicate exports. Fixes #23318
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/rename/should_compile/T23318.hs2
-rw-r--r--testsuite/tests/rename/should_compile/T23318.stderr3
-rw-r--r--testsuite/tests/rename/should_compile/all.T1
3 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/T23318.hs b/testsuite/tests/rename/should_compile/T23318.hs
new file mode 100644
index 0000000000..ac66912992
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T23318.hs
@@ -0,0 +1,2 @@
+module T23318 (T(), T(..)) where
+data T = A | B
diff --git a/testsuite/tests/rename/should_compile/T23318.stderr b/testsuite/tests/rename/should_compile/T23318.stderr
new file mode 100644
index 0000000000..66690c5d1e
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T23318.stderr
@@ -0,0 +1,3 @@
+
+T23318.hs:1:21: warning: [GHC-47854] [-Wduplicate-exports (in -Wdefault)]
+ ‘T’ is exported by ‘T(..)’ and ‘T()’
diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T
index 7885713c04..6e4c5ae749 100644
--- a/testsuite/tests/rename/should_compile/all.T
+++ b/testsuite/tests/rename/should_compile/all.T
@@ -210,3 +210,4 @@ test('GHCINullaryRecordWildcard', combined_output, ghci_script, ['GHCINullaryRec
test('GHCIImplicitImportNullaryRecordWildcard', combined_output, ghci_script, ['GHCIImplicitImportNullaryRecordWildcard.script'])
test('T22122', [expect_broken(22122), extra_files(['T22122_aux.hs'])], multimod_compile, ['T22122', '-v0'])
test('T23240', [req_th, extra_files(['T23240_aux.hs'])], multimod_compile, ['T23240', '-v0'])
+test('T23318', normal, compile, ['-Wduplicate-exports'])