[Issue 2521] New: Not possible to return immutable value by ref
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 17 05:41:00 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2521
Summary: Not possible to return immutable value by ref
Product: D
Version: 2.022
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: aarti at interia.pl
module Test;
immutable int val = 23;
ref int func() {
return val;
}
void main() {
}
----
Result - compilation error:
quicktest.d(3): Error: cast(int)23 is not an lvalue
--
More information about the Digitalmars-d-bugs
mailing list