[commit: ghc] ghc-8.0: Use a correct substitution in tcInstType (1ca01bb)

git at git.haskell.org git at git.haskell.org
Tue Mar 29 17:38:19 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/1ca01bb8932b2c646ec1190ff854a1a3c456123e/ghc

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

commit 1ca01bb8932b2c646ec1190ff854a1a3c456123e
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
    
    (cherry picked from commit 73935326e0cf85ed077b9ab7dd8f197d39e2cd5b)


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

1ca01bb8932b2c646ec1190ff854a1a3c456123e
 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