https://issues.dlang.org/show_bug.cgi?id=14944

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from [email protected] ---
The problem is more subtle than suggested by the summary. Actually the problem
is the **ref** in foreach(). 

Initialization of the array succeeds if you use another form of for loop, e.g

---
import std.stdio;
class Foo {
    static int[10] tbl;
    static this() {
        foreach(i; 0 .. tbl.length) {
            tbl[i] = 1;
        }
    }
}
void main() {
    writeln(Foo.tbl[0]); // 1
}
---

--

Reply via email to