Comment #0 by dlang-bugzilla — 2011-09-12T15:59:19Z
Not sure if this is by design, this works in 2.054 but not in 2.055:
struct A { }
struct B
{
static alias A this;
}
Possibly related: Issue 5622
Comment #1 by k.hara.pg — 2011-09-17T20:31:37Z
This is not regression, is diagnostic issue.
Originally "alias this" only accepts a member symbol of an aggregate itself belongs. Therefore the code in comment #0 is invalid because A is lies outside of B.
By fixing bug 6561, it has been fixed in 2.055, invalid alias this always prints "undefined identifier" error. In this case, we cannot use A as B's alias this symbol, but we can lookup A from inside B. Then this is *diagnostic* issue that the message is not sufficiently descriptive.
In 2.054, following code doesn't work.
----
struct A
{
static void foo(){}
}
struct B
{
static alias A this;
}
void main()
{
B.foo(); // want to call A.foo, but fails
}
----
If this issue is 'regression', above code should work in 2.054, but doesn't.
Comment #2 by dlang-bugzilla — 2011-09-17T20:36:07Z
You're right, thanks. I was mistaken in thinking that it worked in 2.054.