Skip to content

Fix bugs related to shadowing record fields in GHCi

Adam Gundry requested to merge wip/amg/T19322 into master

Fixes #19314 (closed) and fixes #19322 (closed). This resolves some odd corner cases of shadowing of record fields in GHCi:

  • Keep record selectors in the interactive context, so we can use them for solving HasField constraints even if they have been shadowed.
  • Previously, defining fields with DuplicateRecordFields in GHCi lead to strange shadowing behaviour, whereby fields would (accidentally) not shadow other fields. This simplifies things so that fields are shadowed in the same way whether or not DuplicateRecordFields is enabled.

The second point is technically a user-visible change, but it is a very obscure corner and the old behaviour wasn't very useful.

Merge request reports