[GHC] #10269: ApiAnnotations : RdrHsSyn.isFunLhs discards parentheses
GHC
ghc-devs at haskell.org
Thu May 7 21:44:51 UTC 2015
#10269: ApiAnnotations : RdrHsSyn.isFunLhs discards parentheses
-------------------------------------+-------------------------------------
Reporter: alanz | Owner: alanz
Type: bug | Status: patch
Priority: normal | Milestone: 7.10.2
Component: Compiler | Version: 7.10.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | ApiAnnotations
Type of failure: None/Unknown | Architecture:
Blocked By: | Unknown/Multiple
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions: Phab:D832
-------------------------------------+-------------------------------------
Comment (by Alan Zimmerman <alan.zimm@…>):
In [changeset:"5bde9f7c1834ab4da1fad1838afec1a578c26530/ghc"]:
{{{
#!CommitTicketReference repository="ghc"
revision="5bde9f7c1834ab4da1fad1838afec1a578c26530"
ApiAnnotations : RdrHsSyn.isFunLhs discards parentheses
Summary:
The RdrHsSyn.isFunLhs function has the following
isFunLhs e = go e []
where
go (L loc (HsVar f)) es
| not (isRdrDataCon f) = return (Just (L loc f, False, es))
go (L _ (HsApp f e)) es = go f (e:es)
go (L _ (HsPar e)) es@(_:_) = go e es
The treatment of HsPar means that any parentheses around an infix function
will be discarded.
e.g.
(f =*= g) sa i = f (toF sa i) =^= g (toG sa i)
will lose the ( before f and the closing one after g
Test Plan: ./validate
Reviewers: hvr, austin
Reviewed By: austin
Subscribers: bgamari, thomie
Differential Revision: https://phabricator.haskell.org/D832
GHC Trac Issues: #10269
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10269#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list