Use coercionKind instread of zonkTcType in TcFlatten.flatten_tyvar
In TcFlatten.flatten_tyvar3
we had
; orig_kind <- liftTcS $ zonkTcType kind
-- NB: orig_kind is *not* the kind returned from flatten
-- This zonk is necessary because we might later see the tv's kind
-- in canEqTyVarTyVar (where we use getCastedTyVar_maybe).
-- If you remove it, then e.g. dependent/should_fail/T11407 panics
-- See also Note [Flattening]
But in fact the kind of the coercion returned earlier gives the same information, and turns out to be a little faster.
Plus, I hate calling zonkTcType
in the constraint solver; it doesn't "fit" there.
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |