Allow imports to reference multiple fields with the same name (#21625)
If a module `M` exports two fields `f` (using DuplicateRecordFields), we can still accept import M (f) import M hiding (f) and treat `f` as referencing both of them. This was accepted in GHC 9.0, but gave rise to an ambiguity error in GHC 9.2. See #21625. This patch also documents this behaviour in the user's guide, and updates the test for #16745 which is now treated differently.
parent
362cca13
Branches wip/T21694a
No related tags found
Pipeline #56634 canceled
Stage: tool-lint
Stage: quick-build
Stage: full-build
Stage: packaging
Stage: testing
Stage: deploy
Showing
- compiler/GHC/Rename/Names.hs 20 additions, 10 deletionscompiler/GHC/Rename/Names.hs
- docs/users_guide/exts/duplicate_record_fields.rst 8 additions, 1 deletiondocs/users_guide/exts/duplicate_record_fields.rst
- testsuite/tests/overloadedrecflds/should_compile/T21625.hs 5 additions, 0 deletionstestsuite/tests/overloadedrecflds/should_compile/T21625.hs
- testsuite/tests/overloadedrecflds/should_compile/T21625B.hs 6 additions, 0 deletionstestsuite/tests/overloadedrecflds/should_compile/T21625B.hs
- testsuite/tests/overloadedrecflds/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/overloadedrecflds/should_compile/all.T
- testsuite/tests/overloadedrecflds/should_fail/T16745.stderr 9 additions, 9 deletionstestsuite/tests/overloadedrecflds/should_fail/T16745.stderr
- testsuite/tests/overloadedrecflds/should_fail/T16745A.hs 5 additions, 3 deletionstestsuite/tests/overloadedrecflds/should_fail/T16745A.hs