#5288: Less noisy version of -fwarn-name-shadowing
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |       Owner:              
        Type:  feature request   |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.3             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 I would like a flag that warns about name-shadowing in more restricted
 circumstances than the current flag. I.e. I would like examples like these
 not to produce a warning:

 {{{
 foo x = ..
   where
     bar x = ...
 }}}

 {{
 baz z = do
   z <- .... z ...
   return z
 }}}

 But I would like these to produce one:

 {{{
 foo x = ..
   where
     x = ... x ...
 }}}

 {{
 baz z = mdo
   z <- .... z ...
   return z
 }}}

 Basically warn when a definition shadows *itself*. My motivation is that
 code like my first two examples is almost never an error in my experience,
 but my last two examples almost always are examples of my accidentally
 building a loop that evaluates to _|_.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to