[commit: ghc] master: Fix solveOneFromTheOther for RecursiveSuperclasses (6506980)
git at git.haskell.org
git at git.haskell.org
Wed Feb 7 12:16:37 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/65069806ea3637882d584e785dcb9e650271e4b6/ghc
>---------------------------------------------------------------
commit 65069806ea3637882d584e785dcb9e650271e4b6
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Feb 7 11:57:40 2018 +0000
Fix solveOneFromTheOther for RecursiveSuperclasses
This patch fixes the redundant superclass expansion
in Trac #14774.
The main change is to fix TcInterac.solveOneFromTheOther, so
that it does not prefer a work-item with a binding if that binding
transitively depends on the inert item we are comparing it with.
Explained in Note [Replacement vs keeping] in TcInert, esp
item (c) of the "Constraints coming from the same level" part.
To make this work I refactored out a new function
TcEvidence.findNeededEvVars, which was previously buried
inside TcSimplify.neededEvVars.
I added quite a few more comments and signposts about superclass
expansion.
>---------------------------------------------------------------
65069806ea3637882d584e785dcb9e650271e4b6
compiler/typecheck/TcCanonical.hs | 43 +++++++++++++++-----
compiler/typecheck/TcEvidence.hs | 29 ++++++++++++-
compiler/typecheck/TcInteract.hs | 47 ++++++++++++++--------
compiler/typecheck/TcSimplify.hs | 22 +++-------
testsuite/tests/typecheck/should_compile/Makefile | 4 ++
testsuite/tests/typecheck/should_compile/T14774.hs | 13 ++++++
.../tests/typecheck/should_compile/T14774.stdout | 3 ++
testsuite/tests/typecheck/should_compile/all.T | 1 +
8 files changed, 119 insertions(+), 43 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 65069806ea3637882d584e785dcb9e650271e4b6
More information about the ghc-commits
mailing list