summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-02-05 17:37:42 -0600
committerAustin Seipp <austin@well-typed.com>2015-02-05 17:37:42 -0600
commitd4f25cb151db1a539aab66b26ccca4d166562b22 (patch)
tree282c8b87d9553904236b47e1671e170f00709790 /compiler/parser
parentc88e11219c1e914b71d8c630a1f1d4f6f0fb6b9b (diff)
downloadhaskell-d4f25cb151db1a539aab66b26ccca4d166562b22.tar.gz
GRHS with empty wherebinds gets wrong SrcSpan
Summary: When parsing a rhs, the GRHS is constructed via unguardedRHS which is given a SrcSpan which only takes account of the '=' and wherebinds, so does not include the exp when wherebinds are empty. Test Plan: ./validate Reviewers: hvr, austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D643
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index e3760906dd..1bffbeee72 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -1875,7 +1875,7 @@ decl :: { Located (OrdList (LHsDecl RdrName)) }
rhs :: { Located ([AddAnn],GRHSs RdrName (LHsExpr RdrName)) }
: '=' exp wherebinds { sL (comb3 $1 $2 $3)
((mj AnnEqual $1 : (fst $ unLoc $3))
- ,GRHSs (unguardedRHS (comb2 $1 $3) $2)
+ ,GRHSs (unguardedRHS (comb3 $1 $2 $3) $2)
(snd $ unLoc $3)) }
| gdrhs wherebinds { sLL $1 $> (fst $ unLoc $2
,GRHSs (reverse (unLoc $1))