[Issue 5147] New: [CTFE] Return fixed-sized matrix
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 31 14:21:15 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5147
Summary: [CTFE] Return fixed-sized matrix
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-10-31 14:20:21 PDT ---
This is borderline between enhancement and rejects-valid bug report.
DMD 2.050 doesn't support this code:
int[1][1] foo() {
int[1][1] a;
return a;
}
enum int[1][1] m1 = foo();
immutable int[1][1] m2 = foo();
void main() {}
Errors generated:
test.d(2): Error: Slice operation a[] = 0 cannot be evaluated at compile time
test.d(5): Error: cannot evaluate foo() at compile time
This code is very useful to initialize an enum/immutable global matrix.
--
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