[Git][ghc/ghc][wip/int-index/imp-exp-wildcards] 5 commits: Fix syntax error in gadt_syntax.rst
Vladislav Zavialov pushed to branch wip/int-index/imp-exp-wildcards at Glasgow Haskell Compiler / GHC Commits: d4b1e353 by Simon Hengel at 2025-12-10T00:00:02-05:00 Fix syntax error in gadt_syntax.rst - - - - - 91cc8be6 by Cheng Shao at 2025-12-10T00:00:43-05:00 ci: fix "ci.sh clean" to address frequent out of space error on windows runners This patch fixes the `ci.sh clean` logic to address frequent out of space error on windows runners; previously it didn't clean up the inplace mingw blobs, which is the largest source of space leak on windows runners. See added comment for detailed explanation. - - - - - fe2b79f4 by Recursion Ninja at 2025-12-10T08:34:18-05:00 Narrow before optimising MUL/DIV/REM into shifts The MUL/DIV/REM operations can be optimised into shifts when one of the operands is a constant power of 2. However, as literals in Cmm are stored as 'Integer', for this to be correct we first need to narrow the literal to the appropriate width before checking whether the literal is a power of 2. Fixes #25664 - - - - - 06c2349c by Recursion Ninja at 2025-12-10T08:34:58-05:00 Decouple 'Language.Haskell.Syntax.Type' from 'GHC.Utils.Panic' - Remove the *original* defintion of 'hsQTvExplicit' defined within 'Language.Haskell.Syntax.Type' - Redefine 'hsQTvExplicit' as 'hsq_explicit' specialized to 'GhcPass' exported by 'GHC.Utils.Panic' - Define 'hsQTvExplicitBinders' as 'hsq_explicit' specialized to 'DocNameI' exported by 'Haddock.GhcUtils'. - Replace all call sites of the original 'hsQTvExplicit' definition with either: 1. 'hsQTvExplicit' updated definition 2. 'hsQTvExplicitBinders' All call sites never entered the 'XLHsQTyVars' constructor branch, but a call to 'panic' existed on this code path because the type system was not strong enought to guarantee that the 'XLHsQTyVars' construction was impossible. These two specialized functions provide the type system with enough information to make that guarantee, and hence the dependancy on 'panic' can be removed. - - - - - 49888ab8 by Vladislav Zavialov at 2025-12-10T21:47:02+01:00 Subordinate namespace-specified wildcards Add support for subordinate namespace-specified wildcards `X(type ..)` and `X(data ..)` to import and export lists. Examples: import M (Cls(type ..)) -- imports Cls and all its associated types import M (Cls(data ..)) -- imports Cls and all its methods module M (R(data ..), C(type ..)) where -- exports R and all its data constructors and record fields; -- exports C and all its associated types, but not its methods The scope of this change is limited to the case where the wildcard is the only subordinate import/export item, whereas the more complex forms `X(type .., f)` or `X(type .., data ..)` are unsupported and raise the newly introduced PsErrUnsupportedExplicitNamespace error. This restriction may be lifted later. Summary of the changes: 1. Refactor IEThingAll to store its extension field XIEThingAll as a record IEThingAllExt instead of a tuple. 2. Extend the AST by adding a NamespaceSpecifier field to IEThingAllExt, representing an optional namespace specifier `type` or `data` in front of a subordinate wildcard `X(..)`. 3. Extend the grammar in Parser.y with productions for `type ..` and `data ..` in subordinate import/export items. 4. Introduce `filterByNamespaceGREs` to filter [GlobalRdrElt] by a NamespaceSpecifier; use it in `filterImports` and `exports_from_avail` to account for the namespace specifier in IEThingAll. 5. Improve diagnostics by storing more information in DodgyImportsEmptyParent and DodgyExportsEmptyParent. Test cases: T25901_sub_e T25901_sub_f T25901_sub_g T25901_sub_a T25901_sub_b T25901_sub_c T25901_sub_d T25901_sub_w DodgyImports02 DodgyImports03 DodgyImports04 - - - - - 58 changed files: - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Hs/ImpExp.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Types.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Name/Reader.hs - compiler/Language/Haskell/Syntax/Type.hs - docs/users_guide/exts/gadt_syntax.rst - + testsuite/tests/cmm/opt/T25664.hs - + testsuite/tests/cmm/opt/T25664.stdout - testsuite/tests/cmm/opt/all.T - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - + testsuite/tests/rename/should_compile/T25901_sub_e.hs - + testsuite/tests/rename/should_compile/T25901_sub_f.hs - + testsuite/tests/rename/should_compile/T25901_sub_f.stderr - + testsuite/tests/rename/should_compile/T25901_sub_g.hs - + testsuite/tests/rename/should_compile/T25901_sub_g.stderr - + testsuite/tests/rename/should_compile/T25901_sub_g_helper.hs - testsuite/tests/rename/should_compile/all.T - testsuite/tests/rename/should_fail/T23570b.stderr - + testsuite/tests/rename/should_fail/T25901_sub_a.hs - + testsuite/tests/rename/should_fail/T25901_sub_a.stderr - + testsuite/tests/rename/should_fail/T25901_sub_b.hs - + testsuite/tests/rename/should_fail/T25901_sub_b.stderr - + testsuite/tests/rename/should_fail/T25901_sub_c.hs - + testsuite/tests/rename/should_fail/T25901_sub_c.stderr - + testsuite/tests/rename/should_fail/T25901_sub_c_helper.hs - + testsuite/tests/rename/should_fail/T25901_sub_d.hs - + testsuite/tests/rename/should_fail/T25901_sub_d.stderr - + testsuite/tests/rename/should_fail/T25901_sub_d_helper.hs - + testsuite/tests/rename/should_fail/T25901_sub_w.hs - + testsuite/tests/rename/should_fail/T25901_sub_w.stderr - testsuite/tests/rename/should_fail/all.T - testsuite/tests/warnings/should_compile/DodgyExports03.stderr - testsuite/tests/warnings/should_compile/DodgyImports.stderr - + testsuite/tests/warnings/should_compile/DodgyImports02.hs - + testsuite/tests/warnings/should_compile/DodgyImports02.stderr - + testsuite/tests/warnings/should_compile/DodgyImports03.hs - + testsuite/tests/warnings/should_compile/DodgyImports03.stderr - + testsuite/tests/warnings/should_compile/DodgyImports03_helper.hs - + testsuite/tests/warnings/should_compile/DodgyImports04.hs - + testsuite/tests/warnings/should_compile/DodgyImports04.stderr - testsuite/tests/warnings/should_compile/DodgyImports_hiding.stderr - testsuite/tests/warnings/should_compile/all.T - utils/check-exact/ExactPrint.hs - utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs - utils/haddock/haddock-api/src/Haddock/GhcUtils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7acd26bd317252d3270d08e1ec0d240... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7acd26bd317252d3270d08e1ec0d240... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Vladislav Zavialov (@int-index)