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



--- Comment #9 from bearophile_h...@eml.cc 2012-01-05 15:36:21 PST ---
The main real problem (returning a non void from a void function) is now fixed:
https://github.com/D-Programming-Language/dmd/commit/c942d51c8b1103d5ce4c3dfc03ae77c07c687cd6

-----------------

DMD 2.058head accepts code like this:


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


This code is formally correct, because no real value is ignored.

I don't like such code a lot because that code looks like the intent of the
programmer is to return something, while this is not true. Maybe allowing this
is useful for generic code, I don't know. I'd like to see examples of this
usefulness in real code.

(But this discussion looks a bit different from the main issue that is now
fixed, so maybe this should be moved to a new different Bugzilla issue).

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

Reply via email to