diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-12-21 14:13:54 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-12-21 14:14:21 +0000 |
commit | f5cf9d1a1b198edc929e1fa96c6d841d182fe766 (patch) | |
tree | 21f9daccb8a46e0f5b06ab820861a842cecd91b3 /rules | |
parent | a492af06d3264530d134584f22ffb726a16c78ec (diff) | |
download | haskell-f5cf9d1a1b198edc929e1fa96c6d841d182fe766.tar.gz |
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.
Diffstat (limited to 'rules')
0 files changed, 0 insertions, 0 deletions