[commit: ghc] wip/pattern-synonym-backport: When calling the success continuation of a matcher, pass existential tyvars as type arguments, not value arguments (263644d)
git at git.haskell.org
git at git.haskell.org
Sat Dec 20 08:46:51 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/pattern-synonym-backport
Link : http://ghc.haskell.org/trac/ghc/changeset/263644d7a15ad28def18173a23729262728a6515/ghc
>---------------------------------------------------------------
commit 263644d7a15ad28def18173a23729262728a6515
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date: Thu Nov 13 17:47:18 2014 +0800
When calling the success continuation of a matcher, pass existential tyvars
as type arguments, not value arguments
(cherry picked from commit 638991114f9358ee78f32d5d5c98bb3001b52ec9)
>---------------------------------------------------------------
263644d7a15ad28def18173a23729262728a6515
compiler/typecheck/TcPatSyn.lhs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/compiler/typecheck/TcPatSyn.lhs b/compiler/typecheck/TcPatSyn.lhs
index 385c44f..17fe40b 100644
--- a/compiler/typecheck/TcPatSyn.lhs
+++ b/compiler/typecheck/TcPatSyn.lhs
@@ -32,7 +32,6 @@ import Data.Monoid
import Bag
import TcEvidence
import BuildTyCl
-import TypeRep
#include "HsVersions.h"
\end{code}
@@ -126,7 +125,7 @@ tcPatSynMatcher (L loc name) lpat args univ_tvs ex_tvs ev_binds prov_dicts req_d
; let tv_name = mkInternalName uniq (mkTyVarOcc "r") loc
; return $ mkTcTyVar tv_name openTypeKind (SkolemTv False) }
; matcher_name <- newImplicitBinder name mkMatcherOcc
- ; let res_ty = TyVarTy res_tv
+ ; let res_ty = mkTyVarTy res_tv
cont_args = if null args then [voidPrimId] else args
cont_ty = mkSigmaTy ex_tvs prov_theta $
mkFunTys (map varType cont_args) res_ty
@@ -141,7 +140,8 @@ tcPatSynMatcher (L loc name) lpat args univ_tvs ex_tvs ev_binds prov_dicts req_d
; scrutinee <- mkId "scrut" pat_ty
; cont <- mkId "cont" cont_ty
- ; let cont' = nlHsApps cont $ map nlHsVar (ex_tvs ++ prov_dicts ++ cont_args)
+ ; let cont' = nlHsTyApps cont (map mkTyVarTy ex_tvs) $
+ map nlHsVar (prov_dicts ++ cont_args)
; fail <- mkId "fail" fail_ty
; let fail' = nlHsApps fail [nlHsVar voidPrimId]
More information about the ghc-commits
mailing list