[GHC] #5288: Less noisy version of -fwarn-name-shadowing

GHC cvs-ghc at haskell.org
Wed Jun 29 00:26:27 CEST 2011


#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



More information about the Glasgow-haskell-bugs mailing list