Put RdrName in the foExt field of FieldOcc
The main purpose of this commit is to rip RdrName out of FieldOcc, in accordance with #21592, and as a side note it has simplified the method we use to deal with ambiguity somewhat. To do the first, we make FieldOccs store (LIdP p) instead of always storing Located RdrName, and moved the readername to the extension points where necessary. For the second, well, we just turn an ambiguous RdrName into a unbound Name through mkUnboundName. Later during disambiguateRecordBinds of the type checking phase, we will try and do type-directed disambiguation based on the rdrName field (for now), so this hack works out fine. See Note [Ambiguous FieldOcc in record updates] for more details. There are two additional minor changes in this commit: * The HsRecSel constructor of HsExpr has been moved to the extension constuctors, since its really GHC specific. * HsProjection no longer has a Located DotFieldOcc as a field, but just a regular DotFieldOcc, since DotFieldOcc already wraps a located FieldLabelString co-authored by: @Jade <Jade512@proton.me> @alt-romes <rodrigo.m.mesquita@gmail.com> (cherry picked from commit 1587cccf)
Showing
- compiler/GHC/Hs/Binds.hs 1 addition, 2 deletionscompiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Expr.hs 28 additions, 12 deletionscompiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Extension.hs 1 addition, 1 deletioncompiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/Instances.hs 0 additions, 6 deletionscompiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs 0 additions, 11 deletionscompiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs 1 addition, 1 deletioncompiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs 56 additions, 58 deletionscompiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs 4 additions, 4 deletionscompiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Docs.hs 1 addition, 1 deletioncompiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs 29 additions, 30 deletionscompiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Quote.hs 20 additions, 11 deletionscompiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs 2 additions, 1 deletioncompiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs 40 additions, 42 deletionscompiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser/PostProcess.hs 3 additions, 3 deletionscompiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Bind.hs 1 addition, 1 deletioncompiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs 4 additions, 4 deletionscompiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs 13 additions, 14 deletionscompiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Fixity.hs 1 addition, 1 deletioncompiler/GHC/Rename/Fixity.hs
- compiler/GHC/Rename/HsType.hs 5 additions, 6 deletionscompiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Pat.hs 20 additions, 13 deletionscompiler/GHC/Rename/Pat.hs
Loading
Please register or sign in to comment