This boils down to something like
ubyte[3] arr;
arr = arr.init;
arr = [1, 2, 3];
But not exactly that.
recursiveBlockAssign fails because the rhs is a ubyte
Comment #2 by yebblies — 2013-11-20T08:28:00Z
*** Issue 10742 has been marked as a duplicate of this issue. ***
Comment #3 by k.hara.pg — 2014-04-21T07:30:34Z
Reduced test case:
struct Hash11535
{
ubyte[6] _buffer;
void put(scope const(ubyte)[] data...)
{
uint i = 0, index = 0;
auto inputLen = data.length;
(&_buffer[index])[0 .. inputLen-i] = (&data[i])[0 .. inputLen-i];
}
}
auto md5_digest11535(T...)(scope const T data)
{
Hash11535 hash;
hash.put(cast(const(ubyte[]))data[0]);
return hash._buffer;
}
static assert(md5_digest11535(`TEST`) == [84, 69, 83, 84, 0, 0]);
Compiler fix:
https://github.com/D-Programming-Language/dmd/pull/3479
Note that the OP code would not work because std.digest.md does not support CTFE.
Comment #4 by github-bugzilla — 2014-04-21T12:47:02Z