https://issues.dlang.org/show_bug.cgi?id=17351
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #10 from [email protected] --- I seem to have come across a variant of this as well. This works since v2.067: int f1(ref const int p) { return p; } int f2(ref const int[2] p) { return p[0] + p[1]; } void main() { static immutable int[2] P = [ 0, 1 ]; static assert(f1(P[0]) == 0); static assert(f2(P) == 1); } But only if there's the first static assert (!). Comment that out, and it'll complain about 'static variable `P` cannot be read at compile time'. See https://run.dlang.io/is/uyWPmm. --
