Comment #0 by dlang-bugzilla — 2014-03-06T06:44:54Z
////// testStruct.d //////
struct A
{
void fun()
{
}
void caller(T)(T t)
{
t.callee(); // NG
}
}
struct B
{
alias callee = A.fun;
}
void main()
{
A a;
B b;
a.caller(b);
}
//////////////////////////
The above currently does not work.
If you replace t.callee() with T.callee(), then it compiles.
However, that prohibits generic programming when "callee" is an actual method of "T".
Note that this currently works with nested classes:
/////// testClass.d //////
class A
{
void fun()
{
}
class B
{
alias fun = A.fun;
}
}
void main()
{
A a = new A;
A.B b = a.new B;
b.fun(); // OK
}
//////////////////////////
Comment #1 by dlang-bugzilla — 2014-03-06T07:57:07Z