RE: [GHC] #11019: ApiAnnotations: Make all RdrName occurences Located

Alan
| ApiAnnotations: Make all RdrName occurences Located
There is a principle here: that every RdrName occurrence is located. Is this principle articulated in a Note anywhere? I wish it was! (Including an explanation of why.) Otherwise you risk someone removing the change in a few years time.
When I built HsSyn originally I reasoned that
data HsExpr = ...| HsVar RdrName
was better than
data HsExpr = ... | HsVar (Located RdrName0
because the location on the RdrName is identical to that on the LHsExpr, so it's redundant. But you think it is non-redundant. I'm sure you are right (although I don't know why), but it would be a real help to document the invariant and the reasoning in the code somewhere.
Are there any other principles that the code embodies?
Thanks
Simon
| -----Original Message-----
| From: ghc-tickets [mailto:ghc-tickets-bounces@haskell.org] On Behalf
| Of GHC
| Sent: 22 November 2015 23:11
| Cc: ghc-tickets@haskell.org
| Subject: Re: [GHC] #11019: ApiAnnotations: Make all RdrName occurences
| Located
|
| #11019: ApiAnnotations: Make all RdrName occurences Located
| -------------------------------------+--------------------------------
| --
| -------------------------------------+---
| Reporter: alanz | Owner: alanz
| Type: bug | Status: new
| Priority: normal | Milestone: 8.0.1
| Component: Compiler | Version: 7.10.2
| Resolution: | Keywords:
| | ApiAnnotations
| Operating System: Unknown/Multiple | Architecture:
| | Unknown/Multiple
| Type of failure: None/Unknown | Test Case:
| Blocked By: | Blocking:
| Related Tickets: | Differential Rev(s):
| Phab:1512
| Wiki Page: |
| -------------------------------------+--------------------------------
| --
| -------------------------------------+---
|
| Comment (by Ben Gamari
participants (1)
-
Simon Peyton Jones