[commit: ghc] master: Fix egregious typo in checkTauTvUpdate. (d5cd94d)

git at git.haskell.org git at git.haskell.org
Wed Feb 11 20:30:33 UTC 2015


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

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

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

commit d5cd94d7b57dc233ff40bb3e494b7baf1be4d285
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Wed Feb 11 13:13:53 2015 -0500

    Fix egregious typo in checkTauTvUpdate.
    
    The old code used an unzonked type in an occurs-check, which
    would sometimes lead to an infinite loop.
    
    Please merge to ghc-7.10.


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

d5cd94d7b57dc233ff40bb3e494b7baf1be4d285
 compiler/typecheck/TcUnify.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs
index 93f3f11..024d443 100644
--- a/compiler/typecheck/TcUnify.hs
+++ b/compiler/typecheck/TcUnify.hs
@@ -979,7 +979,7 @@ checkTauTvUpdate dflags tv ty
        ; case sub_k of
            Nothing           -> return Nothing
            Just LT           -> return Nothing
-           _  | is_return_tv -> if tv `elemVarSet` tyVarsOfType ty
+           _  | is_return_tv -> if tv `elemVarSet` tyVarsOfType ty1
                                 then return Nothing
                                 else return (Just ty1)
            _  | defer_me ty1   -- Quick test



More information about the ghc-commits mailing list