[Issue 12994] New: Function-local imported name shadowing error
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Thu Jun 26 01:47:14 PDT 2014
    
    
  
https://issues.dlang.org/show_bug.cgi?id=12994
          Issue ID: 12994
           Summary: Function-local imported name shadowing error
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc
This is an enhancement request, but it's borderline being a bug report for the
module system.
Two similar examples:
void main() {
    int map;
    import std.algorithm;
    map!(x => x)([1]);
}
void main() {
    int map;
    import std.algorithm: map;
    map!(x => x)([1]);
}
In both cases dmd 2.066alpha gives:
test.d(4,8): Error: no property 'map' for type 'int[]'
test.d(5,5): Error: template instance map!((x) => x) map is not a template
declaration, it is a variable
In both programs I expect something like a "'map' identifier shadowing error".
An explicit "import std.algorithm: map;" getting totally ignored is not
acceptable, in my opinion.
--
    
    
More information about the Digitalmars-d-bugs
mailing list