http://d.puremagic.com/issues/show_bug.cgi?id=6519
Summary: [CTFE] Problem with inout
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2011-08-17 07:46:59 PDT ---
D2 code:
inout(int[]) foo(inout int[] data) {
return data;
}
void main() {
enum int[] a = [1, 2];
const r1 = foo(a); // OK
enum r2 = foo(a); // Not OK
}
DMD 2.055beta gives:
test.d(7): Error: variable test2.main.r2 only fields, parameters or stack based
variables can be inout
test.d(7): Error: cannot evaluate foo([1,2]) at compile time
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------