[commit: ghc] wip/T8584: tcTySig for PatSynSigs: filter out universially-bound type variables from ex_tvs (f82848d)

git at git.haskell.org git at git.haskell.org
Sun Nov 2 06:42:39 UTC 2014


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

On branch  : wip/T8584
Link       : http://ghc.haskell.org/trac/ghc/changeset/f82848dbe398556d84cd10eb3ac6edf9bba0b999/ghc

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

commit f82848dbe398556d84cd10eb3ac6edf9bba0b999
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Thu Oct 16 22:17:08 2014 +0800

    tcTySig for PatSynSigs: filter out universially-bound type variables from ex_tvs


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

f82848dbe398556d84cd10eb3ac6edf9bba0b999
 compiler/typecheck/TcBinds.lhs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcBinds.lhs b/compiler/typecheck/TcBinds.lhs
index 187d33b..68ce078 100644
--- a/compiler/typecheck/TcBinds.lhs
+++ b/compiler/typecheck/TcBinds.lhs
@@ -1314,7 +1314,8 @@ tcTySig (L loc (PatSynSig (L _ name) args ty (_, ex_tvs, prov) (_, univ_tvs, req
        { ty' <- tcHsSigType ctxt ty
        ; req' <- tcHsContext req
        ; tcHsTyVarBndrs ex_tvs $ \ ex_tvs' -> do
-       { args' <- mapM (tcHsSigType ctxt) $ case args of
+       { ex_tvs' <- return $ filter (`notElem` univ_tvs') ex_tvs'
+       ; args' <- mapM (tcHsSigType ctxt) $ case args of
            PrefixPatSyn tys -> tys
            InfixPatSyn ty1 ty2 -> [ty1, ty2]
        ; prov' <- tcHsContext prov



More information about the ghc-commits mailing list