Summary: Misleading error messages for return expression in
                    void methods.
           Product: D
           Version: 1.056
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Markus Dangl <> 2010-02-25 12:45:45 PST ---
dmd 1.056 gives a misleading error message on invalid code.
The error was not even reported in my previous version (1.045).

Consider the following invalid code:
class C {
    int i;
    void m() {
        return i;

And output of "dmd main.d":
main.d(4): Error: dotvar has no effect in expression (this.i)

The error message could be much clearer about not being able to return
something for a void method.

Testing the same thing with a simple function:
void m() {
    return 1;

gives the following output of "dmd main.d":
main.d(2): Error: long has no effect in expression (1)

Which is still not very clear.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to