[Issue 12030] Detect some wrong array slice assignments at compile time
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jul 5 13:21:21 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=12030
--- Comment #1 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
(In reply to bearophile_hugs from comment #0)
> This contains two related enhancement requests.
>
> Some missed compile-time tests:
>
> void main() {
> ubyte[10] a;
> ubyte[20] b;
> b[1 .. a.length + 2] = a[];
> }
Since https://github.com/dlang/dmd/pull/3485 this no longer compiles:
test.d(4): Error: mismatched array lengths, 11 and 10
--
More information about the Digitalmars-d-bugs
mailing list