| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
This was introduced in commit
45f44e2c9d5db2f25c52abb402f197c20579400f, but it results in lots of
"check_class ~" messages when validating. I've decided to just
comment it out.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
`ppr_tc_args` was printing invisible kind arguments even
when `-fprint-explicit-kinds` wasn't enabled. Easily fixed.
Test Plan: make test TEST=T15341
Reviewers: goldfire, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #15341
Differential Revision: https://phabricator.haskell.org/D4932
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Another `-ddump-splices` bug that can be solved with more
judicious use of parentheses.
Test Plan: make test TEST=T15331
Reviewers: goldfire, bgamari, alanz, tdammers
Reviewed By: tdammers
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15331
Differential Revision: https://phabricator.haskell.org/D4920
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: A simple oversight.
Test Plan: make test TEST=T15324
Reviewers: goldfire, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15324
Differential Revision: https://phabricator.haskell.org/D4910
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This was taken from Richard's branch, which in turn was
submitted to Phab by Matthew, which in turn was commandeered by Ryan.
This fixes an issue with newtype instances in which too many
coercions were being applied in the worker. This fixes the issue by
removing the data family instance axiom from the worker and moving
to the wrapper. Moreover, we now require all newtype instances
to have wrappers, for symmetry with data instances.
Reviewers: goldfire, bgamari, simonpj, mpickering
Reviewed By: mpickering
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #15318
Differential Revision: https://phabricator.haskell.org/D4902
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Before, we were using visible type application to apply
impredicative types to `coerce` in
`GeneralizedNewtypeDeriving`-generated bindings. This approach breaks
down when combined with `QuantifiedConstraints` in certain ways,
which #14883 and #15290 provide examples of. See
Note [GND and QuantifiedConstraints] for all the gory details.
To avoid this issue, we instead use an explicit type signature to
instantiate each GND binding, and use that to bind any type variables
that might be bound by a class method's type signature. This reduces
the need to impredicative type applications, and more importantly,
makes the programs from #14883 and #15290 work again.
Test Plan: make test TEST="T15290b T15290c T15290d T14883"
Reviewers: simonpj, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #14883, #15290
Differential Revision: https://phabricator.haskell.org/D4895
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
There was a buglet in `stripInvisArgs` (which is part of the
pretty-printing pipeline for types) in which only invisble arguments
which came before any visible arguments would be suppressed, but any
invisble arguments that came //after// visible ones would still be
printed, even if `-fprint-explicit-kinds` wasn't enabled.
The fix is simple: make `stripInvisArgs` recursively process the
remaining types even after a visible argument is encountered.
Test Plan: make test TEST=T15308
Reviewers: goldfire, bgamari
Reviewed By: bgamari
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #15308
Differential Revision: https://phabricator.haskell.org/D4891
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
`nlHsFunTy` wasn't parenthesizing its arguments at all,
which led to `-ddump-deriv` producing incorrectly parenthesized
types (since it uses `nlHsFunTy` to construct those types), as
demonstrated in #15307. Fix this by changing `nlHsFunTy` to add
parentheses à la `ppr_ty`: always parenthesizing the argument type
with function precedence, and recursively processing the result type,
adding parentheses for each function type it encounters.
Test Plan: make test TEST=T14578
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #15307
Differential Revision: https://phabricator.haskell.org/D4890
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are several changes here.
* TcInteract has gotten too big, so I moved all the class-instance
matching out of TcInteract into a new module ClsInst. It parallels
the FamInst module.
The main export of ClsInst is matchGlobalInst.
This now works in TcM not TcS.
* A big reason to make matchGlobalInst work in TcM is that we can
then use it from TcValidity.checkSimplifiableClassConstraint.
That extends checkSimplifiableClassConstraint to work uniformly
for built-in instances, which means that we now get a warning
if we have givens (Typeable x, KnownNat n); see Trac #15322.
* This change also made me refactor LookupInstResult, in particular
by adding the InstanceWhat field. I also changed the name of the
type to ClsInstResult.
Then instead of matchGlobalInst reporting a staging error (which is
inappropriate for the call from TcValidity), we can do so in
TcInteract.checkInstanceOK.
* In TcValidity, we now check quantified constraints for termination.
For example, this signature should be rejected:
f :: (forall a. Eq (m a) => Eq (m a)) => blah
as discussed in Trac #15316. The main change here is that
TcValidity.check_pred_help now uses classifyPredType, and has a
case for ForAllPred which it didn't before.
This had knock-on refactoring effects in TcValidity.
|
| |
|
|
|
|
|
| |
See Note [Typeable for Nat and Symbol] in TcInteract,
which I added after discussion on Trac #15322
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a one line fix (and a note) that fixes four tickets, #15007,
#15321 and #15202, #15314
The issue was that errors caused by illegal candidates (according to GHC
stage or being internal names) were leaking to the user, causing
bewildering error messages. If a candidate causes the type checker to
error, it is not a valid hole fit, and should be discarded.
As mentioned in #15321, this can cause a pattern of omissions, which
might be hard to discover. A better approach would be to gather the
error messages, and ask users to report them as GHC bugs. This will be
implemented in a subsequent change.
Reviewers: bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #15007, #15321, #15202, #15314
Differential Revision: https://phabricator.haskell.org/D4909
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`extractSubTerms` (which is extracting pointer and non-pointer fields of a
closure) was computing the alignment incorrectly when aligning a 64-bit value
(e.g. a Double) on i386 by aligning it to 64-bits instead of to word size
(32-bits). This is documented in `mkVirtHeapOffsetsWithPadding`:
> Align the start offset (eg, 2-byte value should be 2-byte aligned).
> But not more than to a word.
Fixes #15061
Test Plan:
Validated on both 32-bit and 64-bit. 32-bit fails with various unrelated stat
failures, but no actual test failures.
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: simonpj, rwbarton, thomie, carter
GHC Trac Issues: #15061
Differential Revision: https://phabricator.haskell.org/D4906
|
|
|
|
|
|
|
|
|
|
|
|
| |
Details are not documented, only the high-level functions
Reviewers: simonpj, hvr, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4911
|
|
|
|
|
|
|
|
|
|
|
|
| |
A GADT declaration surrounded in parens does not det the con_forall
field correctly.
e.g.
data MaybeDefault v where
TestParens :: (forall v . (Eq v) => MaybeDefault v)
Closes #15323
|
| |
|
|
|
|
| |
Comments only: [ci skip]
|
|
|
|
| |
...provoked by Trac #15308
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The level numbers we were getting simply didn't obey the
invariant (ImplicInv) in TcType
Note [TcLevel and untouchable type variables]
That leads to chaos. Easy to fix. I improved the documentation.
I also added an assertion in TcSimplify that checks that
level numbers go up by 1 as we dive inside implications, so
that we catch the problem at source rather than than through
its obscure consequences.
That in turn showed up that TcRules was also generating
constraints that didn't obey (ImplicInv), so I fixed that too.
I have no idea what consequences were lurking behing that
bug, but anyway now it's fixed. Hooray.
|
|
|
|
|
|
|
| |
Make sure the original annotations are still accessible for a promoted
type.
Closes #15303
|
|
|
|
|
|
|
|
|
|
|
|
| |
I wondered if some transformations (ticks) might be "innocuous",
in the sense that they do not unlock a later transformation that
does not occur in the same pass. If so, we could refrain from
bumping the overall tick-count for such innocuous transformations,
and perhaps terminate the simplifier one pass earlier.
BUt alas I found that virtually nothing was innocuous! This
commit just adds a Note to record what I learned, in case
anyone wants to try again.
|
| |
|
|
|
|
|
| |
... plus, reorder equations in toIfaceVar to improve
legibility. No change in behaviour.
|
|
|
|
| |
See Trac #15205
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The refactoring here is driven by the ghastly mess described in
comment:24 of Trac #1520. The overall goal is to simplify the
kind-checking of typev-variable binders, and in particular to narrow
the use of the "in-scope tyvar binder" stuff,
which is needed only for associated types: see the new
Note [Kind-checking tyvar binders for associated types] in TcHsType.
Now
* The "in-scope tyvar binder" stuff is done only in
- kcLHsQTyVars, which is used for the LHsQTyVars of a
data/newtype, or type family declaration.
- tcFamTyPats, which is used for associated family instances;
it now calls tcImplicitQTKBndrs, which in turn usese
newFlexiKindedQTyVar
* tcExpicitTKBndrs (which is used only for function signatures,
data con signatures, pattern synonym signatures, and expression
type signatures) now does not go via the "in-scope tyvar binder"
stuff at all.
While I'm still not happy with all this code, the code is generally
simpler, and I think this is a useful step forward. It does cure
the problem too.
(It's hard to trigger the problem in vanilla Haskell code, because
the renamer would normally use different names for nested binders,
so I can't offer a test.)
|
| |
|
|
|
|
|
|
|
|
|
| |
As Trac #15289 showed, we were carrying on after a type error
in a pattern synonym, and then crashing. This patch improves
error handling for pattern synonyms.
I also moved a bit of code from TcBinds into TcPatSyn, which
helpfully narrows the API.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: "ghc -Wamp XXX.hs" should give "unrecognised warning flag"
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #11477
Differential Revision: https://phabricator.haskell.org/D4785
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The standard[1] for extension naming is to use the XC prefix for the
internal extension points, rather than for a new constructor.
This is violated for IPBind, having
data IPBind id
= IPBind
(XIPBind id)
(Either (Located HsIPName) (IdP id))
(LHsExpr id)
| XCIPBind (XXIPBind id)
Swap the usage of XIPBind and XCIPBind
[1] https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow#Namingconventions
Closes #15302
|
| |
|
|
|
|
|
| |
We call checkReductionDepth in chooseInstance, so there's no
need to call it in selectNextWorkItem too
|
|
|
|
|
|
| |
This patch just removes the CtLoc parameter from trySolveFromInstance,
since it can just as easily (and more uniformly) be gotten from the
CtEvidence it is trying to solve.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #15290 showed that it's possible that we might attempt to use a
quantified constraint to solve an equality in a situation where we
don't have anywhere to put the evidence bindings. This made GHC crash.
This patch stops the crash, but still rejects the pogram. See
Note [Instances in no-evidence implications] in TcInteract.
Finding this bug revealed another lurking bug:
* An infelicity in the treatment of superclasses -- we were expanding
them locally at the leaves, rather than at their binding site; see
(3a) in Note [The superclass story].
As a consequence, TcRnTypes.superclassesMightHelp must look inside
implications.
In more detail:
* Stop the crash, by making TcInteract.chooseInstance test for
the no-evidence-bindings case. In that case we simply don't
use the instance. This entailed a slight change to the type
of chooseInstance.
* Make TcSMonad.getPendingScDicts (now renamed getPendingGivenScs)
return only Givens from the /current level/; and make
TcRnTypes.superClassesMightHelp look inside implications.
* Refactor the simpl_loop and superclass-expansion stuff in
TcSimplify. The logic is much easier to understand now, and
has less duplication.
|
|
|
|
|
|
| |
Richard added a much better version of this Note in commit
26e9806ada8823160dd63ca2c34556e5848b2f45, so I've decided to point
to that instead.
|
|
|
|
| |
Bumps containers submodule, among others.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When GHC links binaries on windows, we pass a -L and -l flag
to gcc for each dependency in the transitive dependency
closure. As this will usually overflow the command argument
limit on windows, we use response files to pass all arguments
to gcc. gcc however internally passes only the -l flags via
a response file to the collect2 command, but puts the -L flags
on the command line. As such if we pass enough -L flags to
gcc--even via a response file--we will eventually overflow the
command line argument length limit due to gcc passing them
to collect2 without resorting to a response file.
To prevent this from happening we move all lirbaries into a
shared temporary folder, and only need to pass a single -L
flag to gcc. Ideally however this was fixed in gcc.
Reviewers: bgamari, Phyx
Reviewed By: bgamari
Subscribers: erikd, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4762
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After commit d650729f9a0f3b6aa5e6ef2d5fba337f6f70fa60, the
`HsEqTy` constructor of `HsType` is essentially dead code. Given that
we want to remove `HsEqTy` anyway as a part of #10056 (comment:27),
let's just rip it out.
Bumps the haddock submodule.
Test Plan: ./validate
Reviewers: goldfire, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #10056
Differential Revision: https://phabricator.haskell.org/D4876
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`(~)` is not an identifier according to GHC's parser, which
is why GHCi's `:info` command wouldn't work on it. To rectify this,
we apply the same fix that was put in place for `(->)`: add `(~)` to
GHC's `identifier` parser production.
Test Plan: make test TEST=T10059
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, mpickering, carter
GHC Trac Issues: #10059
Differential Revision: https://phabricator.haskell.org/D4877
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit 50e7bff7514ebbd74976c1a9fa0db7a8275178ae.
Reverts submodule changes.
Sigh, the haskeline commit isn't quite upstream yet.
|
|
|
|
| |
Bumps containers submodule, among others.
|
|
|
|
| |
This fixes #15282.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch completes the work for #14529 by making sure that all API
Annotations end up attached to a SrcSpan that appears in the final
ParsedSource.
Updates Haddock submodule
Test Plan: ./validate
Reviewers: goldfire, bgamari
Subscribers: rwbarton, thomie, mpickering, carter
GHC Trac Issues: #14529
Differential Revision: https://phabricator.haskell.org/D4867
|
| |
|
|
|
|
| |
[skip ci]
|
| |
|