[GHC] #14630: name shadowing warnings by record pattern synonyms + RecordWildCards or NamedFieldPuns

GHC ghc-devs at haskell.org
Tue Jan 9 09:32:38 UTC 2018


#14630: name shadowing warnings by record pattern synonyms + RecordWildCards or
NamedFieldPuns
-------------------------------------+-------------------------------------
        Reporter:  mizunashi_mana    |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11228            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by adamgundry):

 * cc: mpickering (added)


Comment:

 I agree with Ryan's analysis. Now that we have pattern synoyms with record
 fields, I think we need to disentangle two aspects of `Parent` that are
 now orthogonal:
  * whether the `Name` has a parent at all (this can change due to pattern-
 synonym bundling)
  * whether the `Name` is a record field, and if so, its label (this
 shouldn't change)

 For example, we could add a constructor to `Parent` that has a `Maybe
 FieldLabelString` but not a parent `Name`. This ought to be enough to make
 `isRecFldGRE` accurate and hence calculate the name shadowing warnings
 correctly (fixing this ticket).

 However, this isn't quite enough for #11228, for which there are other
 complications (see discussion on https://github.com/ghc-proposals/ghc-
 proposals/pull/84).

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14630#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list