[Git][ghc/ghc][wip/jade/ast] Refactor FieldOcc and AmbiguousFieldOcc with TTG

Hassan Al-Awwadi (@hassan.awwadi) gitlab at gitlab.haskell.org
Sat Oct 5 06:41:02 UTC 2024



Hassan Al-Awwadi pushed to branch wip/jade/ast at Glasgow Haskell Compiler / GHC


Commits:
3ff46ce0 by Hassan Al-Awwadi at 2024-10-05T08:40:05+02:00
Refactor FieldOcc and AmbiguousFieldOcc with TTG

The main purpose of this commit is to rip RdrName out of FieldOcc, 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.

co-authored by: @Jade <Jade512 at proton.me>
                @Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com>

- - - - -


30 changed files:

- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Fixity.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Pat.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3ff46ce015f15f532f7bbca1b551cb54eac51949

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3ff46ce015f15f532f7bbca1b551cb54eac51949
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241005/9ee53ddb/attachment.html>


More information about the ghc-commits mailing list