Commit e6aefd6e authored by Simon Peyton Jones's avatar Simon Peyton Jones

Use the right in-scope set

I tripped over these calls to substTyWith that didn't obey the
precondition about in-scope variables.  Easily fixed, happily.
parent 5f91ac89
......@@ -1488,13 +1488,14 @@ lintCoercion (InstCo co arg)
= do { (k3, k4, t1',t2', r) <- lintCoercion co
; (k1',k2',s1,s2, r') <- lintCoercion arg
; lintRole arg Nominal r'
; in_scope <- getInScope
; case (splitForAllTy_maybe t1', splitForAllTy_maybe t2') of
(Just (tv1,t1), Just (tv2,t2))
| k1' `eqType` tyVarKind tv1
, k2' `eqType` tyVarKind tv2
-> return (k3, k4,
substTyWith [tv1] [s1] t1,
substTyWith [tv2] [s2] t2, r)
substTyWithInScope in_scope [tv1] [s1] t1,
substTyWithInScope in_scope [tv2] [s2] t2, r)
| otherwise
-> failWithL (text "Kind mis-match in inst coercion")
_ -> failWithL (text "Bad argument of inst") }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment