On Thursday, 14 February 2013 at 00:29:51 UTC, cal wrote:
Should the following work?
import std.traits;
mixin template Foo()
{
void foo(T)(T t) if (isSomeString!T) {}
}
class A
{
void foo()(int i){}
mixin Foo;
}
void main()
{
auto a = new A;
a.foo("hello");
}
Error: template hello.A.foo does not match any function
template declaration. Candidates are:
hello.A.foo()(int i)
If i give the mixin an identifier (mixin Foo _foo) and call it
like a._foo.foo("hello") then it works. I thought it should
work without that though.
AFAIK, this is a bug. It has *probably* already been reported,
but you'd have to check for it.