The following code fails on DMD master:
struct A
{
bool extra;
uint id;
}
struct B
{
uint id;
A toA() const pure nothrow
{
return A(false, id);
}
alias toA this;
}
void main()
{
bool[A] aa;
aa[B(5)] = true;
assert(A(false, 5) in aa);
assert(B(5) in aa);
}
The code fails since commit c31f959, but worked before.