
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 05eb50df by Vladislav Zavialov at 2025-04-13T19:16:38-04:00 Register EpToken in Parser.PostProcess.Haddock (#22558) This change allows us to reject more badly placed Haddock comments. Examples: module -- | Bad comment for the module T17544_kw where data Foo -- | Bad comment for MkFoo where MkFoo :: Foo newtype Bar -- | Bad comment for MkBar where MkBar :: () -> Bar class Cls a -- | Bad comment for clsmethod where clsmethod :: a - - - - - 01944e5e by Vladislav Zavialov at 2025-04-13T19:17:21-04:00 Reject puns in T2T (#24153) This patch implements pun detection in T2T. Consider: x = 42 f, g :: forall a -> ... f (type x) = g x In accordance with the specification, the `g x` function call is renamed as a term, so `x` refers to the top-level binding `x = 42`, not to the type variable binding `type x` as one might expect. This is somewhat counterintuitive because `g` expects a type argument. Forbidding puns in T2T allows us to produce a helpful error message: Test.hs:5:16: error: [GHC-09591] Illegal punned variable occurrence in a required type argument. The name ‘x’ could refer to: ‘x’ defined at Test.hs:3:1 ‘x’ bound at Test.hs:5:9 This commit is a follow up to 0dfb1fa799af254c8a1e1045fc3996af2d57a613 where checking for puns was left as future work. - - - - - cc580552 by Vladislav Zavialov at 2025-04-13T19:18:02-04:00 Additional test cases for #12088, #13790 Extract more test cases from ticket discussions, including multi-module examples. Follow up to 5712e0d646f611dfbfedfd7ef6dff3a18c016edb - - - - - d47bf776 by Matthew Pickering at 2025-04-14T16:44:41+01:00 driver: Use ModuleGraph for oneshot and --make mode This patch uses the `hsc_mod_graph` field for both oneshot and --make mode. Therefore, if part of the compiler requires usage of the module graph, you do so in a uniform way for the two different modes. The `ModuleGraph` describes the relationship between the modules in the home package and units in external packages. The `ModuleGraph` can be queried when information about the transitive closure of a package is needed. For example, the primary use of the ModuleGraph from within the compiler is in the loader, which needs to know the transitive closure of a module so it can load all the relevant objects for evaluation. In --make mode, downsweep computes the ModuleGraph before any compilation starts. In oneshot mode, a thunk is created at the start of compilation, which when forced will compute the module graph beneath the current module. The thunk is only forced at the moment when the user uses Template Haskell. Finally, there are some situations where we need to discover what dependencies to load but haven't loaded a module graph at all. In this case, there is a fallback which computes the transitive closure on the fly and doesn't cache the result. Presumably if you are going to call getLinkDeps a lot, you would compute the right ModuleGraph before you started. Importantly, this removes the ExternalModuleGraph abstraction. This was quite awkward to work with since it stored information about the home package inside the EPS. This patch will also be very useful when implementing explicit level imports, which requires more significant use of the module graph in order to determine which level instances are available at. Towards #25795 ------------------------- Metric Decrease: MultiLayerModulesTH_Make MultiLayerModulesTH_OneShot ------------------------- - - - - - 65470211 by sheaf at 2025-04-16T05:12:10-04:00 base: remove .Internal modules (e.g. GHC.TypeLits) This commit removes the following internal modules from base, as per CLC proposal 217: - GHC.TypeNats.Internal - GHC.TypeLits.Internal - GHC.ExecutionStack.Internal Fixes #25007 - - - - - 58 changed files: - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Env/Types.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeAction.hs - + compiler/GHC/Driver/Messager.hs - compiler/GHC/Driver/Pipeline.hs-boot - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Recomp.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Runtime/Loader.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Unit/External.hs - compiler/GHC/Unit/Finder.hs - − compiler/GHC/Unit/Module/External/Graph.hs - compiler/GHC/Unit/Module/Graph.hs - compiler/GHC/Unit/Module/ModNodeKey.hs - compiler/ghc.cabal.in - libraries/base/base.cabal.in - libraries/base/changelog.md - − libraries/base/src/GHC/ExecutionStack/Internal.hs - − libraries/base/src/GHC/TypeLits/Internal.hs - − libraries/base/src/GHC/TypeNats/Internal.hs - + testsuite/tests/dependent/should_compile/T12088f.hs - + testsuite/tests/dependent/should_compile/T12088g.hs - + testsuite/tests/dependent/should_compile/T12088i.hs - + testsuite/tests/dependent/should_compile/T12088j.hs - + testsuite/tests/dependent/should_compile/T12088mm1.hs - + testsuite/tests/dependent/should_compile/T12088mm1_helper.hs - + testsuite/tests/dependent/should_compile/T12088mm2.hs - + testsuite/tests/dependent/should_compile/T12088mm2_helper.hs - + testsuite/tests/dependent/should_compile/T12088mm3.hs - + testsuite/tests/dependent/should_compile/T12088mm3_helper.hs - + testsuite/tests/dependent/should_compile/T13790.hs - testsuite/tests/dependent/should_compile/all.T - + testsuite/tests/ghc-api/fixed-nodes/InterfaceModuleGraph.hs - + testsuite/tests/ghc-api/fixed-nodes/InterfaceModuleGraph.stdout - testsuite/tests/ghc-api/fixed-nodes/all.T - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.hs - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/plugins/defaulting-plugin/DefaultLifted.hs - + testsuite/tests/vdq-rta/should_fail/T23738_fail_pun.hs - + testsuite/tests/vdq-rta/should_fail/T23738_fail_pun.stderr - testsuite/tests/vdq-rta/should_fail/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a07b9fac8a3c81a06bfd07ab7b070a... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a07b9fac8a3c81a06bfd07ab7b070a... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)