summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-01-05 17:39:08 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-01-06 09:36:20 +0000
commite6aefd6e07ef04d068d727490c640c68c82e4954 (patch)
tree6c02214b0c13aa04a6381c6b6e06ea76d5d2939a
parent5f91ac89a38eb128d374a04c741bbd81c41fed37 (diff)
downloadhaskell-e6aefd6e07ef04d068d727490c640c68c82e4954.tar.gz
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.
-rw-r--r--compiler/coreSyn/CoreLint.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 79e577a61f..1eacd73e0a 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -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") }