Comment #0 by dlang-bugzilla — 2012-03-31T07:20:50Z
//static
string f(alias X)()
{
return null;
}
struct S
{
int i;
mixin(f!i());
}
This program doesn't compile, however uncommenting "static" makes it work.
DMD 2.058 produces this error message:
test.d(8): Error: struct test.S no size yet for forward reference
DMD git produces a different error message:
test.d(2): Error: function test.S.f!(i).f need 'this' to access member f
Note that fixing this issue by making both cases fail to compile would break code. I believe the Orange serialization library uses this trick to stringify field names with minimal syntax overhead.
Comment #1 by k.hara.pg — 2013-11-22T00:19:46Z
Fixed by issue 11533.
*** This issue has been marked as a duplicate of issue 11533 ***