summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-05-09 15:51:01 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2015-05-09 15:52:12 +0200
commit36896826a78d4e7eb003295e6136bd8619695714 (patch)
tree58820460b26afc8c70e224f22ad65d19fe99ec9e /compiler/parser
parentcfef4776d4d508c2fd3eec7bf6137882089745ac (diff)
downloadhaskell-wip/api-annots.tar.gz
ApiAnnotatons : AnnDcolon in wrong place for PatBindwip/api-annots
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 Subscribers: bgamari, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D883 GHC Trac Issues: #10396 Conflicts: testsuite/tests/ghc-api/annotations/.gitignore testsuite/tests/ghc-api/annotations/Makefile testsuite/tests/ghc-api/annotations/all.T
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 8093769c18..7e4faae564 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -2003,8 +2003,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 }