Thank you for your contribution to GHC!
Please take a few moments to verify that your commits fulfill the following:
are either individually buildable or squashed
have commit messages which describe what they do (referring to Notes and tickets using
#NNNNsyntax when appropriate)
have added source comments describing your change. For larger changes you likely should add a Note and cross-reference it from the relevant places.
add a testcase to the testsuite.
This MR implements the NoFieldSelectors proposal.
Summary of the changes
(Items with bold texts are the key parts of the implementation.)
- A new language extension,
FieldSelectors, is added and enabled by default.
We added a new field in
FieldSelectorsis enabled in the definition. As a result, we had to update the use sites of
- Previously, whether
DuplicateRecordFieldsis in effect is represented by Bool; we replaced it by an explicit datatype instead.
lookupOccRn_overloadedhas been renamed to
- It is used to look up variables in expressions.
Selector functions created with
NoFieldSelectorsare hidden from this function.
lookupGlobalOccRn_overloadedhas been renamed to
- It is used to find field names in record patterns, updates, and constructions.
It can find selector functions with
- Created a new datatype
LookupOccRnOverloadedResultin place of
Either Name [Name]
- Fixed the bug #18729 (closed) preventing it work on GHCi