[commit: ghc] ghc-8.4: Fix floating of equalities (594879d)
git at git.haskell.org
git at git.haskell.org
Sun Jan 14 22:07:54 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.4
Link : http://ghc.haskell.org/trac/ghc/changeset/594879dcb2fd5421d5f6ce5341442de32a4aac0a/ghc
>---------------------------------------------------------------
commit 594879dcb2fd5421d5f6ce5341442de32a4aac0a
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Dec 21 14:13:54 2017 +0000
Fix floating of equalities
This rather subtle patch fixes Trac #14584. The problem was
that we'd allowed a coercion, bound in a nested scope, to escape
into an outer scope.
The main changes are
* TcSimplify.floatEqualities takes more care when floating
equalities to make sure we don't float one out that mentions
a locally-bound coercion.
See Note [What prevents a constraint from floating]
* TcSimplify.emitResidualConstraints (which emits the residual
constraints in simplifyInfer) now avoids burying the constraints
for escaping CoVars inside the implication constraint.
* Since I had do to this stuff with CoVars, I moved the
fancy footwork about not quantifying over CoVars from
TcMType.quantifyTyVars to its caller
TcSimplify.decideQuantifiedTyVars. I think its other
callers don't need to worry about all this CoVar stuff.
This turned out to be surprisigly tricky, and took me a solid
day to get right. I think the result is reasonably neat, though,
and well documented with Notes.
(cherry picked from commit f5cf9d1a1b198edc929e1fa96c6d841d182fe766)
>---------------------------------------------------------------
594879dcb2fd5421d5f6ce5341442de32a4aac0a
compiler/typecheck/TcInteract.hs | 3 +-
compiler/typecheck/TcMType.hs | 19 +-
compiler/typecheck/TcSMonad.hs | 7 +-
compiler/typecheck/TcSimplify.hs | 294 ++++++++++++++-------
.../tests/indexed-types/should_fail/T13877.stderr | 10 +-
testsuite/tests/partial-sigs/should_fail/T14584.hs | 56 ++++
.../tests/partial-sigs/should_fail/T14584.stderr | 21 ++
.../tests/partial-sigs/should_fail/T14584a.hs | 16 ++
.../tests/partial-sigs/should_fail/T14584a.stderr | 24 ++
testsuite/tests/partial-sigs/should_fail/all.T | 2 +
.../tests/typecheck/should_fail/VtaFail.stderr | 6 -
11 files changed, 341 insertions(+), 117 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 594879dcb2fd5421d5f6ce5341442de32a4aac0a
More information about the ghc-commits
mailing list