[Issue 24453] [REG2.108] idup fails for inout(T)[] slices

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 26 19:54:57 UTC 2024


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

--- Comment #2 from kinke <kinke at gmx.net> ---
Thanks Steven for checking & linking.

> The `_d_newarrayUPureNothrow` is building an array of `inout(char)`, which
> is wrong at this point. It should always return mutable data, and then
> properly cast at the right place.

I think this used to be valid in general, but copy ctors made this all more
complex - the element type might define a different copy ctor overload when
constructing an immutable instance. In such a case of different copy ctor
overloads, the template should probably fail to instantiate indeed; but
obviously not for trivial types like char.

--


More information about the Digitalmars-d-bugs mailing list