[Issue 17261] Implicit cast from static array to immutable should not be allowed

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Mar 16 10:57:34 PDT 2017


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

--- Comment #3 from hsteoh at quickfur.ath.cx ---
Note that while some may blame implicit slicing for this bug, it still happens
with explicit slicing:

-----
string gunk() {
    string x = func()[]; // still allowed, but shouldn't be
    writeln(x.ptr);
    writeln(x);
    return x;
}
-----

Looks like the compiler's escaping ref analysis has a hole here.

--


More information about the Digitalmars-d-bugs mailing list