[commit: ghc] master: Use the right in-scope set (e6aefd6)
git at git.haskell.org
git at git.haskell.org
Fri Jan 6 10:52:47 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e6aefd6e07ef04d068d727490c640c68c82e4954/ghc
>---------------------------------------------------------------
commit e6aefd6e07ef04d068d727490c640c68c82e4954
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Jan 5 17:39:08 2017 +0000
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.
>---------------------------------------------------------------
e6aefd6e07ef04d068d727490c640c68c82e4954
compiler/coreSyn/CoreLint.hs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 79e577a..1eacd73 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") }
More information about the ghc-commits
mailing list