[commit: ghc] ghc-8.0: Exclude TyVars from the constraint solver (7f15c2b)
git at git.haskell.org
git at git.haskell.org
Sat Feb 27 15:21:39 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/7f15c2b8cd0b8c9f2e407b3a91a5541677df306b/ghc
>---------------------------------------------------------------
commit 7f15c2b8cd0b8c9f2e407b3a91a5541677df306b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Feb 26 09:02:07 2016 +0000
Exclude TyVars from the constraint solver
There is a general invariant that the constraint solver doesn't see
TyVars, only TcTyVars. But when checking the generic-default
signature of a class, we called checkValidType on the generic-default
type, which had the class TyVar free. That in turn meant that it wasn't
considered during flattening, which led to the error reported in
Trac #11608.
The fix is simple: call checkValidType on the /closed/ type. Easy.
While I was at it, I added a bunch of ASSERTs about the TcTyVar
invariant.
(cherry picked from commit 7496be5c0ab96bcc9ab70ab873aa561674b7789d)
>---------------------------------------------------------------
7f15c2b8cd0b8c9f2e407b3a91a5541677df306b
compiler/typecheck/TcErrors.hs | 49 ++++++++++++++-------
compiler/typecheck/TcTyClsDecls.hs | 16 +++++--
compiler/typecheck/TcType.hs | 50 +++++++++++++++-------
testsuite/tests/typecheck/should_compile/T11608.hs | 14 ++++++
testsuite/tests/typecheck/should_compile/all.T | 1 +
5 files changed, 96 insertions(+), 34 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 7f15c2b8cd0b8c9f2e407b3a91a5541677df306b
More information about the ghc-commits
mailing list