diff options
| author | Alan Zimmerman <alan.zimm@gmail.com> | 2015-05-11 17:57:05 +0200 |
|---|---|---|
| committer | Alan Zimmerman <alan.zimm@gmail.com> | 2015-05-11 17:57:05 +0200 |
| commit | ecc3d6be218b1c7a36ee3f2f36c4f3ac4f45c34f (patch) | |
| tree | 6ee3b29a729dfdb047d4b7768ed67384037c74dd /compiler/parser | |
| parent | fe38195eb783fc2f2f2d5ef50fb665b06fd15e82 (diff) | |
| download | haskell-ecc3d6be218b1c7a36ee3f2f36c4f3ac4f45c34f.tar.gz | |
ApiAnnotations : PatBind gives wrong SrcSpan for the pattern.
Summary:
The production for decl_no_th starts
decl_no_th :: { Located (OrdList (LHsDecl RdrName)) }
: sigdecl { $1 }
| '!' aexp rhs {% do { let { e = sLL $1 $> (SectionR (sL1 $1 (HsVar bang_RDR)) $2) };
pat <- checkPattern empty e;
...
The e value should be just the pattern, excluding the rhs, but the span
created includes the rhs.
Test Plan: ./validate
Reviewers: hvr, austin
Reviewed By: austin
Subscribers: bgamari, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D873
GHC Trac Issues: #10358
Diffstat (limited to 'compiler/parser')
| -rw-r--r-- | compiler/parser/Parser.y | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 51b20a0a05..eb2aa0c276 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1986,10 +1986,10 @@ docdecld :: { LDocDecl } decl_no_th :: { Located (OrdList (LHsDecl RdrName)) } : sigdecl { $1 } - | '!' aexp rhs {% do { let { e = sLL $1 $> (SectionR (sL1 $1 (HsVar bang_RDR)) $2) }; + | '!' aexp rhs {% do { let { e = sLL $1 $2 (SectionR (sL1 $1 (HsVar bang_RDR)) $2) }; pat <- checkPattern empty e; _ <- ams (sLL $1 $> ()) - (mj AnnBang $1:(fst $ unLoc $3)); + (fst $ unLoc $3); return $ sLL $1 $> $ unitOL $ sLL $1 $> $ ValD $ PatBind pat (snd $ unLoc $3) placeHolderType |
