Comment #1 by ilyayaroshenko — 2018-12-27T17:32:16Z
Recent DMD BETA and DMD nightly
Comment #2 by ilyayaroshenko — 2019-02-11T12:25:41Z
Reduced test case:
private enum maxMsgLen = 1;
class C
{
private char[maxMsgLen] _payload = void;
}
void initilizePayload(ref return char[maxMsgLen] payload, scope const(char)[] msg)
{
payload[0 .. msg.length] = msg;
}
///
unittest
{
bool func()
{
/// scope messages are copied
auto m = new C();
initilizePayload(m._payload, "msg");
return __ctfe;
}
static assert(func() == 1);
}
===========
onlineapp.d(12): Error: cannot determine length of C([__void])._payload at compile time
onlineapp.d(22): called from here: initilizePayload(m._payload, "msg")
onlineapp.d(26): called from here: func()
onlineapp.d(26): while evaluating: static assert(cast(int)func() == 1)
Comment #3 by dlang-bot — 2019-04-17T09:35:57Z
@kubo39 created dlang/dmd pull request #9634 "Fix Issue 19519 - cannot determine length of static array at compile …" fixing this issue:
- Fix Issue 19519 - cannot determine length of static array at compile time
https://github.com/dlang/dmd/pull/9634
Comment #4 by dlang-bot — 2019-04-17T11:02:01Z
dlang/dmd pull request #9634 "Fix Issue 19519 - cannot determine length of static array at compile …" was merged into stable:
- 171ea64a00caaf1aecb9e782b3c848ff6c90d750 by Hiroki Noda:
Fix Issue 19519 - cannot determine length of static array at compile time
https://github.com/dlang/dmd/pull/9634