[commit: ghc] master: Remove redundant kind check (4431e48)
git at git.haskell.org
git at git.haskell.org
Fri Nov 25 11:30:47 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4431e48e6dc0a0e47328b6d0ed34a9b8503be4b0/ghc
>---------------------------------------------------------------
commit 4431e48e6dc0a0e47328b6d0ed34a9b8503be4b0
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Nov 24 13:57:04 2016 +0000
Remove redundant kind check
The invariants for CTyEqCan mean that this check isn't needed.
Turn it into an ASSERT.
>---------------------------------------------------------------
4431e48e6dc0a0e47328b6d0ed34a9b8503be4b0
compiler/typecheck/TcFlatten.hs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs
index 3adbee1..4fc8414 100644
--- a/compiler/typecheck/TcFlatten.hs
+++ b/compiler/typecheck/TcFlatten.hs
@@ -1457,8 +1457,9 @@ unflatten tv_eqs funeqs
-- NB: unlike unflattenFmv, filling a fmv here /does/
-- bump the unification count; it is "improvement"
-- Note [Unflattening can force the solver to iterate]
- , tyVarKind tv `eqType` typeKind rhs
- = do { is_filled <- isFilledMetaTyVar tv
+ = ASSERT2( tyVarKind tv `eqType` typeKind rhs, ppr ct )
+ -- CTyEqCan invariant should ensure this is true
+ do { is_filled <- isFilledMetaTyVar tv
; elim <- case is_filled of
False -> do { traceTcS "unflatten_eq 2" (ppr ct)
; tryFill ev eq_rel tv rhs }
More information about the ghc-commits
mailing list