dmd/compiler/test/compilable/issue24018.d
FeepingCreature 9bf123c704
Fix issue 24018: set length manually via runtime function. (#15354)
* Fix issue 24018: make `array.length = n` `@system` if default construction is disabled on the array type.
This is needed as there is otherwise no good way to resize an array of non-constructable elements in user code at all.

* Fix issue 24018: instead of calling `array.length =`, call the runtime function that implements `array.length =` instead.
This skips the check for the element type being constructable, which is correct because concatenation doesn't expose unconstructed memory anyway.
2023-06-27 15:51:07 +03:00

10 lines
77 B
D

struct S
{
@disable this();
}
void main()
{
S[] s;
s = s ~ s;
}