Commit d4f25cb1 authored by Alan Zimmerman's avatar Alan Zimmerman Committed by Austin Seipp

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
parent c88e1121
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment