[commit: ghc] wip/T8584.spj: Use user-supplied type variables (when available) in pattern synonym type signatures (c7ced1f)
git at git.haskell.org
git at git.haskell.org
Mon Nov 10 14:08:24 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T8584.spj
Link : http://ghc.haskell.org/trac/ghc/changeset/c7ced1f37263093b224fc7bafbc1fd622e15fd8a/ghc
>---------------------------------------------------------------
commit c7ced1f37263093b224fc7bafbc1fd622e15fd8a
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date: Sun Nov 9 15:46:46 2014 +0800
Use user-supplied type variables (when available) in pattern synonym type signatures
>---------------------------------------------------------------
c7ced1f37263093b224fc7bafbc1fd622e15fd8a
compiler/rename/RnBinds.lhs | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/compiler/rename/RnBinds.lhs b/compiler/rename/RnBinds.lhs
index 8fe5213..0669277 100644
--- a/compiler/rename/RnBinds.lhs
+++ b/compiler/rename/RnBinds.lhs
@@ -847,8 +847,16 @@ renameSig ctxt sig@(PatSynSig v (flag, qtvs) prov req ty)
; let doc = TypeSigCtx $ quotes (ppr v)
; loc <- getSrcSpanM
- ; let (tv_kvs, tvs) = extractHsTysRdrTyVars (ty:unLoc prov ++ unLoc req)
- ; let tv_bndrs = mkHsQTvs . userHsTyVarBndrs loc $ tvs
+ ; let (tv_kvs, mentioned) = extractHsTysRdrTyVars (ty:unLoc prov ++ unLoc req)
+ ; tv_bndrs <- case flag of
+ Implicit ->
+ return $ mkHsQTvs . userHsTyVarBndrs loc $ mentioned
+ Explicit ->
+ do { let heading = ptext (sLit "In the pattern synonym type signature")
+ <+> quotes (ppr sig)
+ ; warnUnusedForAlls (heading $$ docOfHsDocContext doc) qtvs mentioned
+ ; return qtvs }
+ Qualified -> panic "renameSig: Qualified"
; bindHsTyVars doc Nothing tv_kvs tv_bndrs $ \ tyvars -> do
{ (prov', fvs1) <- rnContext doc prov
More information about the ghc-commits
mailing list