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

           Summary: Wrong error message with return in void function
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-03-10 05:02:48 PST ---
This is a wrong program:

void foo(int x) {
    return x;
}
void main() {}


Currently dmd2 generates a bad error message:
temp.d(2): Error: var has no effect in expression (x)

A much better error message can be:
temp.d(2): Error: return can't be used in a void function.

Bad error messages like this one do waste my programming time.

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

Reply via email to