https://issues.dlang.org/show_bug.cgi?id=13228
--- Comment #2 from [email protected] --- I think simple cases like this could be supported by the same length range analysis: void foo(int[7]) {} void main() { int[3] a; int[2] b, c; foo(a ~ b ~ c); // No run-time length test here. } void foo(int[2]) {} void main() { int[5] a; const int len = 2; foo(a[0 .. len]); // OK const int[] b = new int[2]; foo(a[0 .. b.length]); // Currently an error } Here the run-time test of the length of 'a' can be omitted, because it can't be longer than 'b': int n = 8; void main() { const a = new int[n % 5]; int[10] b; b[0 .. a.length] = 0; } --
