| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch, referring to a data constructor in a term-level
context led to a scoping error:
ghci> id Int
<interactive>:1:4: error: Data constructor not in scope: Int
After this patch, the renamer falls back to the type namespace
and successfully finds the Int. It is then rejected in the type
checker with a more useful error message:
<interactive>:1:4: error:
• Illegal term-level use of the type constructor ‘Int’
imported from ‘Prelude’ (and originally defined in ‘GHC.Types’)
• In the first argument of ‘id’, namely ‘Int’
In the expression: id Int
We also do this for type variables.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Instead of recreating the HomeUnit from the DynFlags every time we need
it, we store it in the HscEnv.
|
|
|
|
|
| |
!3798 added documentation and semantics for the flags,
but not parsing.
|
|
|
|
|
|
|
|
|
|
|
| |
Firstly this improves code clarity.
But it also has performance benefits as we no longer
go through the name of the TyCon to get at it's unique.
In order to make this work the recursion check for TyCon
has been moved into it's own module in order to avoid import
cycles.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a long-standing bug in the desugaring of record
updates for data families, when the latter involves a GADT. It's
all explained in Note [Update for GADTs] in GHC.HsToCore.Expr.
Building the correct cast is surprisingly tricky, as that Note
explains.
Fixes #18809. The test case (in indexed-types/should_compile/T18809)
contains several examples that exercise the dark corners.
|
| |
|
|
|
|
|
|
|
|
|
| |
A cleanup in 7f418acf61e accidentally discarded some parens in
ConDeclGADT.
Make sure these stay in the AST in a usable format.
Also ensure the AnnLolly does not get lost in a GADT.
|
|
|
|
|
|
|
|
|
| |
Previously we only matched on *variables* whose unfoldings were a ConApp
of the form `IS lit#` or `NS lit##`. But we forgot to match on the
ConApp directly... As a consequence, constant folding only worked after
the FloatOut pass which creates bindings for most sub-expressions. With
this patch, matching on bignums works even with -O0 (see bignumMatch
test).
|
|
|
|
| |
Fixes #17919.
|
|
|
|
|
| |
Some RTS ways are exposed via settings (ghcThreaded, ghcDebugged) but
not all. It's simpler if the RTS exposes them all itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On windows the stack has to be allocated 4k at a time, otherwise we get
a segfault. This is done by using a helper ___chkstk_ms that is provided
by libgcc. The Haskell side already knows how to handle this but we need
to do the same from STG. Previously we would drop the stack in StgRun
but would only make it valid whenever the scheduler loop ran.
This approach was fundamentally broken in that it falls apart when you
take a signal from the OS. We see it less often because you initially
get allocated a 1MB stack block which you have to blow past first.
Concretely this means we must always keep the stack valid.
Fixes #18601.
|
|
|
|
|
|
| |
In Cmm we can only have real units identified with an UnitId. Other
units (on-the-fly instantiated units and holes) are only used in
type-checking backpack sessions that don't produce Cmm.
|
|
|
|
|
|
|
|
|
|
|
| |
* Include funTyCon in exposedPrimTyCons.
Every single place using exposedPrimTyCons was adding funTyCon
manually.
* Remove unused synTyConResKind and ieLWrappedName
* Add recordSelectorTyCon_maybe
* In exprType, panic instead of giving a trace message and dummy output.
This prevents #18767 reoccurring.
* Fix compilation error in fragile concprog001 test (part of #18732)
|
|
|
|
|
|
|
|
|
|
| |
When linear types are disabled, HsUnrestrictedArrow is treated as
HslinearArrow.
Move this adjustment into the type checking phase, so that the parsed
source accurately represents the source as parsed.
Closes #18791
|
| |
|
|
|
|
|
| |
Before this patch -flink-rts could link with GHC's rts instead of the
selected one.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the atomix exchange over the Ptr type to an internal module.
Fix a bug caused by us passing ptr-to-ptr instead of ptr to
atomic exchange.
Renamed interlockedExchange to exchangePtr.
I've also added an cas primitive. It turned out we don't need it
for WinIO but I'm leaving it in as it's useful for other things.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, `integerDecodeDouble#` is known-key so that it can be
recognised in constant folding. But that is very brittle and doesn't
survive worker/wrapper, which we even do for
`NOINLINE` things since #13143.
Also it is a trade-off: The implementation of `integerDecodeDouble#`
allocates an `Integer` box that never cancels aways if we don't inline
it.
Hence we recognise the `decodeDouble_Int64#` primop instead in constant
folding, so that we can inline `integerDecodeDouble#`. As a result,
`integerDecodeDouble#` no longer needs to be known-key.
While doing so, I realised that we don't constant-fold
`decodeFloat_Int#` either, so I also added a RULE for it.
`integerDecodeDouble` is dead, so I deleted it.
Part of #18092. This improves the 32-bit `realToFrac`/`toRational`:
Metric Decrease:
T10359
|
|
|
|
| |
Patch taken from https://gitlab.haskell.org/ghc/ghc/-/issues/18624#note_300673
|
|
|
|
|
|
| |
1. Fix and update section headers in GHC/Hs/Extension.hs
2. Delete the unused 'XCoreAnn' and 'XTickPragma' families
3. Avoid calls to 'panic' in 'pprStmt'
|
|
|
|
| |
[skip ci]
|
|
|
|
| |
It did not do any useful work.
|
|
|
|
| |
A follow-up to !4020 (5830a12c46e7227c276a8a71213057595ee4fc04)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because the generated `KindRep`s don't have an unfolding, !3230 did not
actually stop to compute, attach and serialise unnecessary CPR
signatures for them. As already said in
`Note [CPR for data structures]`, that leads to bloated interface
files which is ultimately quadratic for Nested CPR.
So we don't attach any CPR signature to bindings that
* Are not thunks (because thunks are not in WHNF)
* Have arity 0 (which means the top-level constructor is not a lambda)
If the data structure has an unfolding, we continue to look through it.
If not (as is the case for `KindRep`s), we look at the unchanged CPR
signature and see `topCprType`, as expected.
|
| |
|
|
|
|
| |
These are not reported by GHC because Happy adds {-# OPTIONS_GHC -w #-}
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Haskell and Cmm parsers/lexers now report errors and warnings using ADTs
defined in GHC.Parser.Errors. They can be printed using functions in
GHC.Parser.Errors.Ppr.
Some of the errors provide hints with a separate ADT (e.g. to suggest to
turn on some extension). For now, however, hints are not consistent
across all messages. For example some errors contain the hints in the
main message. I didn't want to change any message with this patch. I
expect these changes to be discussed and implemented later.
Surprisingly, this patch enhances performance. On CI
(x86_64/deb9/hadrian, ghc/alloc):
parsing001 -11.5%
T13719 -2.7%
MultiLayerModules -3.5%
Naperian -3.1%
Bump haddock submodule
Metric Decrease:
MultiLayerModules
Naperian
T13719
parsing001
|
| |
|
| |
|
|
|
|
|
|
| |
Add `mainModuleNameIs` to DynFlags and demote
`mainModIs` to function which uses the homeUnit from DynFlags
it is created from.
|
|
|
|
| |
Fixes #18767.
|
|
|
|
|
|
|
| |
See updated Note [Use loose types in inert set] in
GHC.Tc.Solver.Monad.
Close #18753.
|
|
|
|
|
| |
There are still global variables but only 3 booleans instead of a single
DynFlags.
|
|
|
|
| |
Necessary for recent Win32 bump.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now `desugarLocalBind` (formerly `desugarLet`) reasons about
* `FunBind`s that
* Have no pattern matches (so which aren't functions)
* Have a singleton match group with a single GRHS
* (which may have guards)
* and looks through trivial post-typechecking `AbsBinds` in doing so
to pick up the introduced renamings.
And desugars to `PmLet` LYG-style guards. Since GRHSs are no longer
denoted simply by `NonEmpty PmGRHS`, but also need to carry a `[PmGrd]`
for the `PmLet`s from `LocalBind`s, I added `PmGRHSs` to capture that.
Since we call out to the desugarer more often, I found that there were
superfluous warnings emitted when desugaring e.g. case expressions.
Thus, I made sure that we deactivate any warnings in the LYG desugaring
steps by the new wrapper function `noCheckDs`.
There's a regression test in `T18626`. Fixes #18626.
|
|
|
|
| |
Bump haddock submodule
|
|
|
|
|
|
|
|
| |
Detect when the user forgets to enable the LinearTypes
extension and produce a better error message.
Steals the (a %m) syntax from TypeOperators, the workaround
is to write (a % m) instead.
|
|
|
|
|
|
| |
Implements GHC Proposal #356
Updates the haddock submodule.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We were missing this case previously.
Close #18528.
Metric Decrease:
T18223
T5321Fun
|
|
|
|
|
| |
This comment dates back to 3df40b7b78044206bbcffe3e2c0a57d901baf5e8
and does not seem relevant anymore.
|
|
|
|
|
|
|
|
|
|
| |
The parser produces an AST where the (->)
is already associated correctly:
1. (->) has the least possible precedence
2. (->) is right-associative
Thus we don't need to handle it in mkHsOpTyRn.
|
|
|
|
|
|
|
| |
As of 686e06c59c3aa6b66895e8a501c7afb019b09e36,
GHC.Parser.PostProcess.mergeOps no longer exists.
[ci skip]
|
|
|
|
| |
This was broken when we added multiplicity to the function type.
|
| |
|