Bug 6512 – [CTFE] new T[][] doesn't work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-08-16T13:51:00Z
Last change time
2011-08-24T12:58:15Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-08-16T13:51:20Z
This is almost an enhancement request. int foo() { new int[][](1, 1); return 0; } enum _ = foo(); void main() {} test.d(2): Error: Cannot interpret new int[][](1u,1u) at compile time test.d(5): Error: cannot evaluate foo() at compile time While this code works: int foo() { int[][] m; m.length = 1; m[0].length = 1; assert(m == [[0]]); return 0; } enum _ = foo(); void main() {}
Comment #1 by bugzilla — 2011-08-24T12:58:15Z