Sorry, this is a compiler bug, because of the incomplete implementation for the language enhancement from 2.063.
Code to illustrate issue.
int foo(Range )(Range s, in dchar c) { return 1; } // A
int foo(T, size_t n)(ref T[n] s, in dchar c) { return 2; } // B
void main()
{
char[64] buf;
// Supported from 2.063: (http://dlang.org/changelog#implicitarraycast)
assert(foo(buf[0..32], '\0') == 2);
// Not yet supported case (it's a compiler bug)
assert(foo(buf[], '\0') == 2);
}
In both cases (buf[0..23] and buf[]), the foo calls should match to B, because it's specialized version to the static array argument than A.
Comment #8 by k.hara.pg — 2015-06-27T12:46:19Z
(In reply to Kenji Hara from comment #7)
> Sorry, this is a compiler bug, because of the incomplete implementation for
> the language enhancement from 2.063.
PR to fix dmd:
https://github.com/D-Programming-Language/dmd/pull/4779