#5288: Less noisy version of -fwarn-name-shadowing
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.0.3       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by batterseapower):

 My thinking is that when I write:

 {{{
 foo rn = ... rn ...
   where
     rn = ... rn ...
 }}}

 My intention is almost invariably to bind a slightly-modified version of
 rn. However, in the code above I have made a mistake and reused the old
 name for the new version. What I should have written was:

 {{{
 foo rn = ... rn' ...
   where
     rn' = ... rn ...
 }}}

 The fact that the "rn =  ... rn ..." binding shadowed an existing binding
 called rn is the clue that I was trying to slightly-modify an existing
 binding. I don't want to warn if "rn =  ... rn ..." does not cause any
 shadowing because no such clue exists.

 Does that make more sense?

 I used to write programs with this error at the rate of perhaps 1 program
 per 20 hours of coding, but I'm getting better at avoiding it.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to