[Issue 3922] Wrong error message with return in void function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 8 11:15:39 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=3922
kennytm at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kennytm at gmail.com
Platform|x86 |All
Version|2.041 |D2
OS/Version|Windows |All
--- Comment #4 from kennytm at gmail.com 2011-06-08 11:11:04 PDT ---
The error seems to be that, in a 'void' function, the statement
return expr;
is rewritten to
{
expr;
return;
}
so e.g. the following should-be-wrong (?) code
int a() { return 4; }
void b() { return a(); }
will compile successfully.
--
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