struct A
{
void foo() {}
void connect()
{
foreach (overload; __traits(getOverloads, typeof(this), "foo"))
{
}
}
}
Error: variable test.A.connect.overload cannot be declared to be a function
Comment #1 by samukha — 2012-11-07T19:19:12Z
Changed the title since the bug is not specific to foreach or getOverloads. Related to http://d.puremagic.com/issues/show_bug.cgi?id=8971
Another test case:
template Tuple(A...)
{
alias A Tuple;
}
struct A
{
void foo() {}
void connect()
{
alias Tuple!(__traits(getOverloads, typeof(this), "foo")) overloads;
}
}
Error: expression this.foo is not a valid template value argument
Comment #2 by k.hara.pg — 2012-11-08T05:04:27Z
The bug cause is same as bug 8771, so this is also a regression.
https://github.com/D-Programming-Language/dmd/pull/1268
Max, thanks to your report. When I fixed bug 8971, I had completely forgotten the case for struct member function.
Comment #3 by samukha — 2012-11-08T05:33:01Z
No problem. Thanks for your efforts.
Comment #4 by github-bugzilla — 2012-11-08T07:17:32Z