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

GHC ghc-devs at haskell.org
Tue Jan 30 14:47:34 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, #11970    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 If the check happened later and you could use `Id`s then calling
 `isRecordSelector` would be appropriate.

 However, this check looks far too aggressive anyway, if you ever shadow a
 selector in a module with `RecordWildCards` enabled then you don't get a
 warning.

 {{{
 {-# LANGUAGE RecordWildCards #-}
 module Foo where

 data T = T {a :: Int }

 -- No warning about a
 qux (T b) = let a = 2 in 5
 }}}

 In general it looks like the code dealing with shadowing could do with
 some attention.

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


More information about the ghc-tickets mailing list