Re: [GHC] #3262: Identifiers beginning with _ should not be considered for shadowing

2009-05-29 Thread GHC
#3262: Identifiers beginning with _ should not be considered for shadowing
-+--
Reporter:  batterseapower|Owner:  
Type:  proposal  |   Status:  closed  
Priority:  normal|Milestone:  
   Component:  Compiler  |  Version:  6.10.2  
Severity:  trivial   |   Resolution:  fixed   
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by simonpj):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => fixed

Comment:

 Good idea.  Done
 {{{
 Thu May 28 16:23:59 BST 2009  simo...@microsoft.com
   * Fix Trac #3262: suppress name-shadow warning for _names

   Adopt Max's suggestion for name shadowing, by suppressing shadowing
   warnings for variables starting with "_".  A tiny bit of refactoring
   along the way.

 M ./compiler/basicTypes/NameSet.lhs -1 +1
 M ./compiler/basicTypes/OccName.lhs -8 +7
 M ./compiler/rename/RnEnv.lhs -1 +3
 M ./compiler/typecheck/TcInstDcls.lhs -1 +1
 M ./docs/users_guide/using.xml +5
 }}}
 Simon

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3262: Identifiers beginning with _ should not be considered for shadowing

2009-05-27 Thread GHC
#3262: Identifiers beginning with _ should not be considered for shadowing
-+--
Reporter:  batterseapower|  Owner:  
Type:  proposal  | Status:  new 
Priority:  normal|  Component:  Compiler
 Version:  6.10.2|   Severity:  trivial 
Keywords:|   Testcase:  
  Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-+--
 The following program:

 {{{
 main = do
   let _ignored = 10
   let _ignored = 20
   return ()
 }}}

 Prints this warning (when compiled with, for example, -Wall):

 {{{
 temp.hs:3:6:
 Warning: This binding for `_ignored' shadows the existing binding
bound at temp.hs:2:6
  In the binding group for: _ignored
 }}}

 In my opinion identifiers prefixed with _ should be ignored for the
 purposes of determining shadowing in the same way as they are ignored for
 the purposes of checking if something is bound but not used. So in
 particular, this warning would not be generated.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs