D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4045 - [CTFE] increasing array length
Summary: [CTFE] increasing array length
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-04-02 14:21 UTC by bearophile_hugs
Modified: 2015-06-09 05:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010-04-02 14:21:48 UTC
(Not tested with the latest bug fixes, so this can be already fixed)


int foo() {
    int[] a;
    a.length = 1;
    return 0;
}
enum int _ = foo();
void main() {}


dmd 2.042 gives:

test.d(3): Error: (a.length) = 1u cannot be evaluated at compile time