Don't report used duplicate record fields as unused
This commit fixes the bug reported in #24035 in which the import of a duplicate record field could be erroneously reported as unused. The issue is that an import of the form "import M (fld)" can import several different 'Name's, and we should only report an error if ALL of those 'Name's are unused, not if ANY are. Note [Reporting unused imported duplicate record fields] in GHC.Rename.Names explains the solution to this problem. Fixes #24035
Showing
- compiler/GHC/Hs/ImpExp.hs 0 additions, 1 deletioncompiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Rename/Names.hs 127 additions, 25 deletionscompiler/GHC/Rename/Names.hs
- testsuite/tests/deriving/should_compile/T17324.stderr 2 additions, 2 deletionstestsuite/tests/deriving/should_compile/T17324.stderr
- testsuite/tests/module/T11970A.stderr 2 additions, 2 deletionstestsuite/tests/module/T11970A.stderr
- testsuite/tests/module/mod176.stderr 2 additions, 2 deletionstestsuite/tests/module/mod176.stderr
- testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr 5 additions, 5 deletions...rloadedrecflds/should_fail/overloadedrecfldsfail06.stderr
- testsuite/tests/rename/should_compile/T14881.stderr 2 additions, 2 deletionstestsuite/tests/rename/should_compile/T14881.stderr
- testsuite/tests/rename/should_compile/T24035.hs 9 additions, 0 deletionstestsuite/tests/rename/should_compile/T24035.hs
- testsuite/tests/rename/should_compile/T24035_aux.hs 5 additions, 0 deletionstestsuite/tests/rename/should_compile/T24035_aux.hs
- testsuite/tests/rename/should_compile/T24035b.hs 14 additions, 0 deletionstestsuite/tests/rename/should_compile/T24035b.hs
- testsuite/tests/rename/should_compile/T24035b.stderr 3 additions, 0 deletionstestsuite/tests/rename/should_compile/T24035b.stderr
- testsuite/tests/rename/should_compile/all.T 2 additions, 0 deletionstestsuite/tests/rename/should_compile/all.T
Loading
Please register or sign in to comment