[Issue 3922] Wrong error message with return in void function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 28 06:34:12 PDT 2010


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



--- Comment #1 from bearophile_hugs at eml.cc 2010-03-28 06:34:11 PDT ---
This program:


void foo() { return 0; }
enum x = foo();
void main() {}



With dmd 2.042 gives a wrong error message:
test.d(2): Error: variable bug3.x voids have no value

A better error message can be:
test.d(1): Error: return statement not allowed in void functions.

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


More information about the Digitalmars-d-bugs mailing list