[Git][ghc/ghc][master] Rework built-in and punned names (#25174, #25179, #25180, #25182)
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Thu Jan 23 23:06:12 UTC 2025
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
51e3ec83 by Vladislav Zavialov at 2025-01-22T20:41:32+03:00
Rework built-in and punned names (#25174, #25179, #25180, #25182)
This patch rewrites part of the logic for dealing with built-in and
punned names, making it more principled and fixing a few bugs.
* Kill off filterCTuple. Its purpose was to improve pretty-printing of
constraint tuples, and the appropriate place for this is namePun_maybe.
* Remove unitTyCon, unboxedUnitTyCon, and soloTyCon from wiredInTyCons.
Their inclusion in the list was a workaround for shoddy logic in
lookupOrigNameCache. Now we treat tuples of all arities uniformly.
* In isBuiltInOcc_maybe, only match on actual built-in syntax, e.g. "FUN"
shouldn't be there (#25174). Also take ListTuplePuns into account (#25179).
* When matching OccNames, use the ShortByteString directly to avoid
potentially costly conversions to ByteString and String.
* Introduce isInfiniteFamilyOrigName_maybe, a purpose-built helper for
looking up tuples/sums in the OrigNameCache. This clears up the previously
convoluted relation between the orig name cache and built-in syntax.
* Reuse isKnownOrigName_maybe to eliminate the need for isPunOcc_maybe.
* Classify MkSolo and MkSolo# as UserSyntax, thus fixing whole-module
reexports (#25182).
* Teach valid-hole-fits about tuples, unboxed tuples, and unboxed sums,
up to a certain arity (#25180).
* Drop the unnecessary special case for unary constraint tuples in the
type checker (finish_tuple). It was a workaround for the lack of CSolo.
* Update Notes and other comments, add tests.
- - - - -
30 changed files:
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Uniques.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Plugins.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Types/Name/Cache.hs
- compiler/GHC/Types/Name/Ppr.hs
- libraries/base/src/GHC/Base.hs
- libraries/base/src/GHC/Exts.hs
- testsuite/tests/core-to-stg/T24124.stderr
- testsuite/tests/ghc-api/T18522-dbg-ppr.hs
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- + testsuite/tests/rename/should_compile/ReExportTuples.hs
- + testsuite/tests/rename/should_compile/T25182.hs
- testsuite/tests/rename/should_compile/all.T
- testsuite/tests/simplStg/should_compile/T15226b.stderr
- + testsuite/tests/th/FunNameTH.hs
- testsuite/tests/th/T13776.hs
- testsuite/tests/th/T13776.stderr
- testsuite/tests/th/T17380.stderr
- + testsuite/tests/th/T25174.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/51e3ec839c378f0da7052278a56482f0349e9bc7
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/51e3ec839c378f0da7052278a56482f0349e9bc7
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/20250123/769e788b/attachment.html>
More information about the ghc-commits
mailing list