[Issue 319] New: local variable can hide member variable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 2 14:34:51 PDT 2006


http://d.puremagic.com/issues/show_bug.cgi?id=319

           Summary: local variable can hide member variable
           Product: D
           Version: 0.165
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: benoit at tionex.de


class C{
    int mVal;
    public this(){
        int mVal = 2;
    }
    public void func(){
        int mVal = 2;
    }
}

This compiles. But I think using a local variable, hiding a member variable
should be illegal.


-- 




More information about the Digitalmars-d-bugs mailing list