[commit: ghc] master: Use a correct substitution in tcInstType (7393532)

git at git.haskell.org git at git.haskell.org
Tue Mar 29 11:31:39 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/73935326e0cf85ed077b9ab7dd8f197d39e2cd5b/ghc

>---------------------------------------------------------------

commit 73935326e0cf85ed077b9ab7dd8f197d39e2cd5b
Author: Bartosz Nitka <niteria at gmail.com>
Date:   Tue Mar 29 12:41:59 2016 +0200

    Use a correct substitution in tcInstType
    
    `ty` doesn't have to be a closed type, so we need to add its
    free vars to the in-scope set. They don't seem to be
    available anywhere nearby, so we have to compute them.
    
    Test Plan: ./validate
    
    Reviewers: goldfire, austin, bgamari, simonpj
    
    Reviewed By: simonpj
    
    Subscribers: thomie, simonmar
    
    Differential Revision: https://phabricator.haskell.org/D2042
    
    GHC Trac Issues: #11371


>---------------------------------------------------------------

73935326e0cf85ed077b9ab7dd8f197d39e2cd5b
 compiler/typecheck/TcMType.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs
index 628c9e3..cb9ed72 100644
--- a/compiler/typecheck/TcMType.hs
+++ b/compiler/typecheck/TcMType.hs
@@ -439,7 +439,7 @@ tcInstType inst_tyvars ty
                             return ([], theta, tau)
 
         (tyvars, rho) -> do { (subst, tyvars') <- inst_tyvars tyvars
-                            ; let (theta, tau) = tcSplitPhiTy (substTyUnchecked subst rho)
+                            ; let (theta, tau) = tcSplitPhiTy (substTyAddInScope subst rho)
                             ; return (tyvars', theta, tau) }
 
 tcSkolDFunType :: Type -> TcM ([TcTyVar], TcThetaType, TcType)



More information about the ghc-commits mailing list