[Git][ghc/ghc][wip/structured-ghci-errors] 20 commits: warnings: Find out if a qualified name is in the interactive scope directly
sheaf (@sheaf)
gitlab at gitlab.haskell.org
Sat Jan 18 10:06:00 UTC 2025
sheaf pushed to branch wip/structured-ghci-errors at Glasgow Haskell Compiler / GHC
Commits:
f56558be by Matthew Pickering at 2025-01-07T13:53:03-05:00
warnings: Find out if a qualified name is in the interactive scope directly
There were two ad-hoc mechanisms used to determine which modules were in
the interactive scope.
1. Look at everything in the GRE, to see what is imported qualified.
2. Look at the last loaded module in the HPT.
(1) Is very inefficient, GlobalRdrEnvs can be very big.
(2) is incorrect, there is no reason to assume the "last" thing added to
the HPT has any relevance to module loading order.
Happily, the same checks can be implemented directly by looking at the
interactive imports from the interactive context. This mirrors what
happens for normal imports.
Arguably, the error reporting code shouldn't be doing this kind of
processing and it should be an option is set when rendering the error
message. However, this just improves the situation and doesn't block
progress on that front in future.
See #14225 and #15611
Fixes #25600
- - - - -
84155cdb by Simon Peyton Jones at 2025-01-07T13:53:40-05:00
Tidy up kcConDecls
Addresses #25630
In particular,
* Introduce ConArgKind and use it.
* Make kcConDecls and tcConDecls work the same way
concerning the kind of argument types
- - - - -
6c12b6cf by Bryan Richter at 2025-01-07T18:15:02-05:00
Remove tmp files after toolchain check
Fixes #25620
- - - - -
42826a89 by Cheng Shao at 2025-01-07T18:15:39-05:00
xxhash: bump to v0.8.3
- - - - -
185f17e4 by sheaf at 2025-01-07T18:16:15-05:00
Fix typo in GHC.Tc.Solver.Solve.runTcPluginsWanted
- - - - -
23099752 by Luite Stegeman at 2025-01-08T00:33:33+01:00
Add flags for switching off speculative evaluation.
We found that speculative evaluation can increase the amount of
allocations in some circumstances. This patch adds new flags for
selectively disabling speculative evaluation, allowing us to
test the effect of the optimization.
The new flags are:
-fspec-eval
globally enable speculative evaluation
-fspec-eval-dictfun
enable speculative evaluation for dictionary functions (no effect
if speculative evaluation is globally disabled)
The new flags are on by default for all optimisation levels.
See #25284
- - - - -
0161badc by Ben Gamari at 2025-01-09T17:30:05-05:00
rts/printClosure: Print IPE information for thunks and functions
This makes it considerably easier to grok the structure of the heap
when IPE information is available.
- - - - -
023f36f5 by Rodrigo Mesquita at 2025-01-10T14:57:48-05:00
user_guide: Note -pgmP/-optP are for /Haskell/-CPP
Fixes #25574
- - - - -
e1c133f2 by Ben Gamari at 2025-01-10T14:58:25-05:00
dump-decls: Suppress unit-ids
While the testsuite driver already normalizes these away, they are
nevertheless a severe nuisance when diffing outside of the testsuite.
Intriguingly, this doesn't completely eliminate the unit IDs; some
wired-in names are still printed. However, this is a cheap and helpful
improvement over the status quo so I am simply going to accept this.
Fixes #25334.
- - - - -
2e7bf446 by sheaf at 2025-01-13T10:55:26+01:00
Remove SDocs from ErrCtxt & ErrInfo
This commit:
- turns the SDoc used in ErrCtxt into a proper error datatype,
ErrCtxtMsg, which contains all the different error contexts that
can be added,
- replaces ErrInfo with [ErrCtxt].
ErrInfo used to contain two SDocs; the first is replaced with [ErrCtxt],
and the second is removed, with the relevant information being put
in the appropriate error message constructors.
Fixes #23436
- - - - -
2d62b970 by Mike Pilgrem at 2025-01-13T12:59:10-05:00
Re CLC #300 - Specify fmap for NonEmpty as map
See:
* https://github.com/haskell/core-libraries-committee/issues/300
Seeks to:
* move existing instances for NonEmpty (except of Eq and Ord) out of GHC.Internal.Base into new GHC.Internal.Data.NonEmpty (to avoid otherwise unavoidable cycles in the module graph);
* move map out of Data.List.NonEmpty (base package) into GHC.Internal.Data.NonEmpty;
* define fmap as map for NonEmpty instance of Functor, avoiding code duplication;
* re-export map from existing GHC.Internal.Data.List.NonEmpty; and
* re-export map from Data.List.NonEmpty (base package);
without breaking anything in the GHC repository.
Various tests *.stdout and *.stderr files are amended also.
- - - - -
ab3ab3e3 by Luite Stegeman at 2025-01-13T12:59:58-05:00
compiler/coreprep: Turn off dictionary speculation by default
Speculative evaluation can cause performance regressions,
therefore we turn it off by default. It can be enabled again
with the -fspec-eval-dictfun flag
See #25284
- - - - -
3d9cacd5 by Patrick at 2025-01-14T02:34:46+08:00
Enhance kind inference for data family instances
This commit improves kind inference for data family instances by kind-checking
the constructors, for H98 and newtype declarations (ONLY), as well as
kind-checking the result kind signature (when using GADT syntax).
This fixes #25611.
Typechecker changes:
In `tcDataFamInstHeader`, we now kind-check the constructors using
`kcConDecls`, for H98-style decls and newtype decls ONLY.
See Note [Kind inference for data family instances].
Testsuite changes:
- The T25611{a,b,c,d} tests test the new kind inference implementation.
- a,b: infer result kind from constructors (H98 case)
- c: renamed version of test UnliftedNewtypesUnassociatedFamilyFail,
which now passes
- d: GADT case, checking that we don't infer overly rigid kinds when
kind-checking the constructors in data family instances.
- DataInstanceKindsDefaults tests defaulting data instance kinds
without UnliftedNewtypes or UnliftedDatatypes, as outlined in
Note [Defaulting result kind of newtype/data family instance].
Also a few notes are updated to reflect the changes.
Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones at gmail.com>
- - - - -
f6493dbc by amesgen at 2025-01-15T18:47:23-05:00
wasm: prevent bundlers from resolving import("node:timers")
This fixes the following esbuild error:
✘ [ERROR] Could not resolve "node:timers"
www/ghc_wasm_jsffi.js:66:25:
66 │ return (await import("node:timers")).setImmediate;
╵ ~~~~~~~~~~~~~
The package "node:timers" wasn't found on the file system but is built into node. Are you trying
to bundle for node? You can use "--platform=node" to do that, which will remove this error.
Previously (i.e. after !13503), one had to work around this by passing
`--external:node:timers`.
- - - - -
87e82e2e by sheaf at 2025-01-16T14:51:45+01:00
Use checkTyEqRhs to make types concrete
This commit refactors makeTypeConcrete to call checkTyEqRhs with
the appropriate parameters. This avoids duplicating subtle logic
in two places in the compiler.
Changes:
1. Refactor of 'TyEqFlags'. Now 'TyEqFlags' stores a 'TEFTask', which
is a description of which of the following checks we want to
perform in 'checkTyEqRhs':
- occurs check
- level check
- concreteness check
In the process, the 'AreUnifying' datatype has been removed, as it
is no longer needed.
2. Refactor of 'checkTyVar':
a. Make use of the new 'TEFTask' data type to decide which checks
to perform.
In particular, this ensures that we perform **both** a
concreteness check and a level check when both are required;
previously we only did a concreteness check (that was a bug!).
b. Recursively call 'checkTyVar' on the kind of unfilled
metavariables. This deals with a bug in which we failed to
uphold the invariant that the kind of a concrete type must
itself be concrete. See test cases T23051, T23176.
3. Re-write of 'makeTypeConcrete', which now simply calls
'checkTyEqRhs' with appropriate 'TyEqFlags'/'TEFTask'.
This gets rid of code duplication and risk for the two code paths
going out-of-sync.
Fixes #25616. See also #23883.
- - - - -
5a8f35bd by ARATA Mizuki at 2025-01-17T11:17:49-05:00
x86 NCG: Use correct format for MOVD in the implementation of unpackInt64X2#
MOVD takes the input format.
Fixes #25658
- - - - -
14f8a7ec by Mateusz Goślinowski at 2025-01-17T22:49:09+00:00
Allow multiline strings in JS FFI (#25633)
- - - - -
854c2f75 by Simon Peyton Jones at 2025-01-18T02:54:08-05:00
Fix a buglet in tcSplitForAllTyVarsReqTVBindersN
The problem was that an equation in `split` had two guards (one about
visiblity and one about `n_req`). So it fell thorugh if /either/
was False. But the next equation then assumed an invisible binder.
Simple bug, easily fixed. Fixes #25661.
- - - - -
264a1186 by sheaf at 2025-01-18T10:05:56+00:00
Generalise GHC diagnostic code infrastructure
This commit generalises the infrastructure used for diagnostic codes,
allowing it to be used for other namespaces than the GHC namespace.
In particular, this enables GHCi to re-use the same infrastructure to
emit error messages.
- - - - -
bf4f5ad3 by Jade at 2025-01-18T10:05:56+00:00
Add structured errors to GHCi (#23338)
This patch creates the 'GhciCommandErrorMessage' data type which
implents the 'Diagnostic' class and also provides error code for these
error conditions.
- - - - -
30 changed files:
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/Config/CoreToStg/Prep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Ppr.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Infer.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/09ee56b9eb270dde86fa75a1c3d329f42012734c...bf4f5ad31ddeb87baad10de47f84081648f808dc
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/09ee56b9eb270dde86fa75a1c3d329f42012734c...bf4f5ad31ddeb87baad10de47f84081648f808dc
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/20250118/aae488d7/attachment-0001.html>
More information about the ghc-commits
mailing list