X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcImprove.lhs;h=9093ccbbb8957ee86b4e7b525836f2f5928dfe3a;hb=fe69f3c1d6062b90635963aa414c33951bf18427;hp=7ba6d21327da9aebb92411cb4e90c89d6f7a1810;hpb=7185a7c33692e7b8f01a6557a34d68225501e54b;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcImprove.lhs b/ghc/compiler/typecheck/TcImprove.lhs index 7ba6d21..9093ccb 100644 --- a/ghc/compiler/typecheck/TcImprove.lhs +++ b/ghc/compiler/typecheck/TcImprove.lhs @@ -6,7 +6,7 @@ module TcImprove ( tcImprove ) where import Name ( Name ) import Class ( Class, FunDep, className, classExtraBigSig ) import Unify ( unifyTyListsX, matchTys ) -import Subst ( mkSubst, substTy ) +import Subst ( mkSubst, emptyInScopeSet, substTy ) import TcEnv ( tcGetInstEnv, classInstEnv ) import TcMonad import TcType ( TcType, TcTyVar, TcTyVarSet, zonkTcType, zonkTcTypes ) @@ -104,8 +104,9 @@ checkFd free (t_x, t_y) (s_x, s_y) = zonkUnifyTys free t_x s_x `thenTc` \ msubst -> case msubst of Just subst -> - let t_y' = map (substTy (mkSubst emptyVarEnv subst)) t_y - s_y' = map (substTy (mkSubst emptyVarEnv subst)) s_y + let full_subst = mkSubst emptyInScopeSet subst + t_y' = map (substTy full_subst) t_y + s_y' = map (substTy full_subst) s_y in zonkEqTys t_y' s_y' `thenTc` \ eq -> if eq then