summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2011-06-10 23:31:03 +0000
committerDavid Waern <david.waern@gmail.com>2011-06-10 23:31:03 +0000
commita0770aa618f81e04737ba7bf4047ae4e7b644671 (patch)
tree488e5abfc0e68ba7045febac28c4df608287728a /compiler/parser
parentf31e93496d7b7ec631b9402be9b566d0f5d2e1fa (diff)
downloadhaskell-a0770aa618f81e04737ba7bf4047ae4e7b644671.tar.gz
Change TypeSig and GenericSig to take a list of names (fixes #1595).
This is a merge of a patch contributed by Michal Terepeta and the recent generics changes.
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y.pp2
-rw-r--r--compiler/parser/RdrHsSyn.lhs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 102f989332..25c65d10b3 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -1241,7 +1241,7 @@ sigdecl :: { Located (OrdList (LHsDecl RdrName)) }
{% do s <- checkValSig $1 $3
; return (LL $ unitOL (LL $ SigD s)) }
| var ',' sig_vars '::' sigtypedoc
- { LL $ toOL [ LL $ SigD (TypeSig n $5) | n <- $1 : unLoc $3 ] }
+ { LL $ toOL [ LL $ SigD (TypeSig ($1 : unLoc $3) $5) ] }
| infix prec ops { LL $ toOL [ LL $ SigD (FixSig (FixitySig n (Fixity $2 (unLoc $1))))
| n <- unLoc $3 ] }
| '{-# INLINE' activation qvar '#-}'
diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs
index a9433441e8..10274e1823 100644
--- a/compiler/parser/RdrHsSyn.lhs
+++ b/compiler/parser/RdrHsSyn.lhs
@@ -774,7 +774,7 @@ checkValSig
-> P (Sig RdrName)
checkValSig (L l (HsVar v)) ty
| isUnqual v && not (isDataOcc (rdrNameOcc v))
- = return (TypeSig (L l v) ty)
+ = return (TypeSig [L l v] ty)
checkValSig lhs@(L l _) ty
= parseErrorSDoc l ((text "Invalid type signature:" <+>
ppr lhs <+> text "::" <+> ppr ty)