dmd/compiler/test/compilable/issue9884.d
2022-07-09 18:53:07 +02:00

25 lines
372 B
D

// https://issues.dlang.org/show_bug.cgi?id=9884
module issue9884;
const(int)[] data;
static this()
{
data = new int[10];
foreach (ref x; data) x = 1;
data[] = 1;
}
struct Foo
{
static const(int)[] data;
static this()
{
this.data = new int[10];
foreach (ref x; this.data) x = 1;
this.data[] = 1;
}
}
void main() {}