| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idea was promted by Trac #9939, but it was Christmas, so I did
some recreational programming that went much further.
The idea is to warn when a constraint in a user-supplied context is
redundant. Everything is described in detail in
Note [Tracking redundant constraints]
in TcSimplify.
Main changes:
* The new ic_status field in an implication, of type ImplicStatus.
It replaces ic_insol, and includes information about redundant
constraints.
* New function TcSimplify.setImplicationStatus sets the ic_status.
* TcSigInfo has sig_report_redundant field to say whenther a
redundant constraint should be reported; and similarly
the FunSigCtxt constructor of UserTypeCtxt
* EvBinds has a field eb_is_given, to record whether it is a given
or wanted binding. Some consequential chagnes to creating an evidence
binding (so that we record whether it is given or wanted).
* AbsBinds field abs_ev_binds is now a *list* of TcEvBiinds;
see Note [Typechecking plan for instance declarations] in
TcInstDcls
* Some significant changes to the type checking of instance
declarations; Note [Typechecking plan for instance declarations]
in TcInstDcls.
* I found that TcErrors.relevantBindings was failing to zonk the
origin of the constraint it was looking at, and hence failing to
find some relevant bindings. Easy to fix, and orthogonal to
everything else, but hard to disentangle.
Some minor refactorig:
* TcMType.newSimpleWanteds moves to Inst, renamed as newWanteds
* TcClassDcl and TcInstDcls now have their own code for typechecking
a method body, rather than sharing a single function. The shared
function (ws TcClassDcl.tcInstanceMethodBody) didn't have much code
and the differences were growing confusing.
* Add new function TcRnMonad.pushLevelAndCaptureConstraints, and
use it
* Add new function Bag.catBagMaybes, and use it in TcSimplify
|
|
|
|
|
|
|
|
|
|
| |
The main change is in TypeRep.pprTheta, so we print
Eq a
for a singleton, but
(Eq a, Show a)
for multiple constraints.
There are lots of trivial knock-on changes to error messages
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular
In the type signature for:
f :: Int -> Int
I added the colon
Also reword the "maybe you haven't applied a function to enough arguments?"
suggestion to make grammatical sense.
These tiny changes affect a lot of error messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is a rewrite of the algorithm to solve for Coercible "instances".
A preliminary form of these ideas is at
https://ghc.haskell.org/trac/ghc/wiki/Design/NewCoercibleSolver
The basic idea here is that the `EqPred` constructor of `PredTree`
now is parameterised by a new type `EqRel` (where
`data EqRel = NomEq | ReprEq`). Thus, every equality constraint can
now talk about nominal equality (the usual case) or representational
equality (the `Coercible` case).
This is a change from the previous
behavior where `Coercible` was just considered a regular class with
a special case in `matchClassInst`.
Because of this change, representational equalities are now
canonicalized just like nominal ones, allowing more equalities
to be solved -- in particular, the case at the top of #9117.
A knock-on effect is that the flattener must be aware of the
choice of equality relation, because the inert set now stores
both representational inert equalities alongside the nominal
inert equalities. Of course, we can use representational equalities
to rewrite only within another representational equality --
thus the parameterization of the flattener.
A nice side effect of this change is that I've introduced a new
type `CtFlavour`, which tracks G vs. W vs. D, removing some ugliness
in the flattener.
This commit includes some refactoring as discussed on D546.
It also removes the ability of Deriveds to rewrite Deriveds.
This fixes bugs #9117 and #8984.
Reviewers: simonpj, austin, nomeata
Subscribers: carter, thomie
Differential Revision: https://phabricator.haskell.org/D546
GHC Trac Issues: #9117, #8984
|
| |
|
|
|
|
| |
Fixes Trac #9658
|
|
|
|
| |
Thanks to slyfox for noticing this reregression.
|
| |
|
|
|
|
| |
This fixes Trac #9096
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update several old
http://hackage.haskell.org/trac/ghc
URLs references to the current
http://ghc.haskell.org/trac/ghc
URLs.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds a suggestion
Possible fix: add a type signature for âfâ
when we have a GADT-style definition with a
type we can't figure out.
See Note [Suggest adding a type signature] in TcErrors.
This initially came up in the discussion of Trac #8968.
|
|
|
|
|
|
|
| |
This matches GCC's choice of Unicode quotation marks (i.e. U+2018 and U+2019)
and therefore looks more familiar on the console. This addresses #2507.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
| |
in which case it is a wontfix (see #8569)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
(unfortunately, not to the better, these might need some more
massaging.)
|
| |
|
|
|
|
| |
The related bugs are #8553 and #8525.
|
| |
|
|
|
|
| |
(this is related to #3647)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Almost all are re-orderings of relevant-binding output
Relevant bindings include
+ m :: Map (a, b) elt (bound at T3169.hs:12:17)
+ b :: b (bound at T3169.hs:12:13)
lookup :: (a, b) -> Map (a, b) elt -> Maybe elt
(bound at T3169.hs:12:3)
- b :: b (bound at T3169.hs:12:13)
- m :: Map (a, b) elt (bound at T3169.hs:12:17)
|
|
|
|
|
| |
Authored-by: David Luposchainsky <dluposchainsky@gmail.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
| |
|
| |
|
|
|
|
|
|
| |
Many of the files modified are just wibbles to output, because now
tycons have roles attached to them, which are produced in the debugging
dumps.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
In effect, the error context for naked variables now takes up
a "slot" in the context stack; but it is often empty. So the
context stack becomes one shorter in those cases. I don't think
this matters; indeed, it's aguably an improvement. Anyway that's
why so many tests are affected.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This means adding a few type signature, and some tests failing
(as they should) rather than succeeding
|
|
|
|
| |
Also some expected/actual messages are now the right way round
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Notably
* Showing relevant bindings
* Not suggesting add instance (Num T); see Trac #7222
|
| |
|
|
|
|
| |
and for recording extra untouchable variables.
|
| |
|