On Saturday, 3 December 2016 at 19:28:52 UTC, Stefan Koch wrote:
On Saturday, 3 December 2016 at 18:16:21 UTC, Stefan Koch wrote:
[...]
StructLiteral regressions fixed.
That one was hard to find.
Basically the for Array arguments interfered with this one.
Arguments are technically the same expression as everything
else.
But in order to support targets that do have native function
calls,
and in order to archive more performance for the interpreter
they have to be treated quite differently from non-argument
expressions.
For now they should work, but it's brittle at best.
The following code now compiles with newCTFE:
struct S
{
uint u1;
uint u2;
}
S makeTenTen()
{
return S(10, 10);
}
S makeS(uint a, uint b)
{
return S(a, b);
}
uint getu2(S s)
{
return s.u2;
}
static assert(getu2(S(10, 14)) == 14);
static assert(makeTenTen() == makeS(10, 10));