www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4715] New: Bad error message with update for already defined variable

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

           Summary: Bad error message with update for already defined
                    variable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This wrong D2 program:

void main() {
    int foo = 1;
    int foo = 1;
}


Produces a good error message (dmd 2.048):
test.d(3): Error: declaration test.main.foo is already defined


But this similar wrong program:

void main() {
    int foo = 1;
    int foo -= 1;
}


Produces two wrong error messages:
test.d(3): semicolon expected, not '-='
test.d(3): found '-=' instead of statement


I'd like this second situation to generate the same error as before.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 22 2010