summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-05-21 15:48:07 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2015-05-21 15:48:07 +0200
commitc488da851c39ca202cdd056091176acbabdd7dd4 (patch)
treec2c3ea3a805beb5fb67e327e24f4f46808b57637 /compiler/parser
parent0df14b5db06751f817d3ba794cc74ac54519b5b8 (diff)
downloadhaskell-c488da851c39ca202cdd056091176acbabdd7dd4.tar.gz
ApiAnnotatons : AnnDcolon in wrong place for PatBind
Summary: In the following code fragment let ls :: Int = undefined the `::` is attached to the ls function as a whole, rather than to the pattern on the LHS. Test Plan: ./validate Reviewers: hvr, austin Reviewed By: austin Subscribers: bgamari, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D883 GHC Trac Issues: #10396
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index 5a862a8058..c167da0a1c 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -2002,8 +2002,9 @@ decl_no_th :: { Located (OrdList (LHsDecl RdrName)) }
case r of {
(FunBind n _ _ _ _ _) ->
ams (L l ()) (mj AnnFunId n:(fst $2)) >> return () ;
- _ -> return () } ;
- _ <- ams (L l ()) (ann ++ (fst $2) ++ (fst $ unLoc $3));
+ (PatBind (L lh _lhs) _rhs _ _ _) ->
+ ams (L lh ()) (fst $2) >> return () } ;
+ _ <- ams (L l ()) (ann ++ (fst $ unLoc $3));
return $! (sL l (unitOL $! (sL l $ ValD r))) } }
| pattern_synonym_decl { sLL $1 $> $ unitOL $1 }
| docdecl { sLL $1 $> $ unitOL $1 }