4050 – [CTFE] array struct member slice update

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4050 - [CTFE] array struct member slice update
Summary: [CTFE] array struct member slice update
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: 1330
Blocks:
Show dependency tree / graph
Reported: 2010年04月02日 14:47 UTC by bearophile_hugs
Modified: 2015年06月09日 05:11 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010年04月02日 14:47:06 UTC
(Not tested with the latest bug fixes, so this can be already fixed)
struct Foo {
 int[1] data;
}
int bar() {
 Foo f;
 f.data = [1];
 return 0;
}
enum int _ = bar();
void main() {}
dmd 2.042 gives:
test.d(6): Error: Slice operation f.data[] = [1] cannot be evaluated at compile time
test.d(9): Error: cannot evaluate bar() at compile time
test.d(9): Error: cannot evaluate bar() at compile time


AltStyle によって変換されたページ (->オリジナル) /