diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2018-05-18 08:43:11 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2018-05-18 17:16:17 +0100 |
commit | 2bbdd00c6d70bdc31ff78e2a42b26159c8717856 (patch) | |
tree | 60701b6613e1822f3007d87e8d4f0bbc707ea4bf /testsuite/tests/polykinds/T8566.stderr | |
parent | efe405447b9fa88cebce718a6329091755deb9ad (diff) | |
download | haskell-2bbdd00c6d70bdc31ff78e2a42b26159c8717856.tar.gz |
Orient TyVar/TyVar equalities with deepest on the left
Trac #15009 showed that, for Given TyVar/TyVar equalities, we really
want to orient them with the deepest-bound skolem on the left. As it
happens, we also want to do the same for Wanteds, but for a different
reason (more likely to be touchable). Either way, deepest wins:
see TcUnify Note [Deeper level on the left].
This observation led me to some significant changes:
* A SkolemTv already had a TcLevel, but the level wasn't really being
used. Now it is!
* I updated added invariant (SkolInf) to TcType
Note [TcLevel and untouchable type variables], documenting that
the level number of all the ic_skols should be the same as the
ic_tclvl of the implication
* FlatSkolTvs and FlatMetaTvs previously had a dummy level-number of
zero, which messed the scheme up. Now they get a level number the
same way as all other TcTyVars, instead of being a special case.
* To make sure that FlatSkolTvs and FlatMetaTvs are untouchable (which
was previously done via their magic zero level) isTouchableMetaTyVar
just tests for those two cases.
* TcUnify.swapOverTyVars is the crucial orientation function; see the
new Note [TyVar/TyVar orientation]. I completely rewrote this function,
and it's now much much easier to understand.
I ended up doing some related refactoring, of course
* I noticed that tcImplicitTKBndrsX and tcExplicitTKBndrsX were doing
a lot of useless work in the case where there are no skolems; I
added a fast-patch
* Elminate the un-used tcExplicitTKBndrsSig; and thereby get rid of
the higher-order parameter to tcExpliciTKBndrsX.
* Replace TcHsType.emitTvImplication with TcUnify.checkTvConstraints,
by analogy with TcUnify.checkConstraints.
* Inline TcUnify.buildImplication into its only call-site in
TcUnify.checkConstraints
* TcS.buildImplication becomes TcS.CheckConstraintsTcS, with a
simpler API
* Now that we have NoEvBindsVar we have no need of termEvidenceAllowed;
nuke the latter, adding Note [No evidence bindings] to TcEvidence.
Diffstat (limited to 'testsuite/tests/polykinds/T8566.stderr')
-rw-r--r-- | testsuite/tests/polykinds/T8566.stderr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/polykinds/T8566.stderr b/testsuite/tests/polykinds/T8566.stderr index 52a4b21490..d368d055f0 100644 --- a/testsuite/tests/polykinds/T8566.stderr +++ b/testsuite/tests/polykinds/T8566.stderr @@ -1,12 +1,12 @@ T8566.hs:32:9: error: - • Could not deduce (C ('AA (t1 (I a ps)) as) ps fs0) + • Could not deduce (C ('AA (t (I a ps)) as) ps fs0) arising from a use of ‘c’ from the context: C ('AA (t (I a ps)) as) ps fs bound by the instance declaration at T8566.hs:30:10-67 or from: 'AA t (a : as) ~ 'AA t1 as1 bound by a pattern with constructor: - A :: forall k (t :: k) (as :: [U *]) (r :: [*]). I ('AA t as) r, + A :: forall v (t :: v) (as :: [U *]) (r :: [*]). I ('AA t as) r, in an equation for ‘c’ at T8566.hs:32:5 The type variable ‘fs0’ is ambiguous |