Test program:
struct RefCounted(T)
{
T _payload;
ref T refCountedPayload()
{
return _payload;
}
alias refCountedPayload this;
}
struct S(int x_)
{
alias x_ x;
}
alias RefCounted!(S!1) Rs;
static assert(Rs.x == 1);
Version <= 2.060: Works
Version >= 2.061:
test.d(22): Error: need 'this' for refCountedPayload type ref S!(1)()
Comment #1 by andrej.mitrovich — 2013-04-06T11:12:57Z
I don't see any static fields here.
Comment #2 by dsimcha — 2013-04-06T11:39:55Z
Misspoke. I meant compile-time fields, aliases and possibly others that I haven't tested.