On Tuesday, 2 July 2013 at 00:45:23 UTC, cal wrote:
import std.conv, std.stdio, std.algorithm;

struct S {
void opDispatch(string s, T...)(T t) if (s.startsWith("foo")) {
        writeln(s);
    }
}

void main() {
    S s;
    s.foo();
auto p = s.to!string(); // Error: s.opDispatch!("to") isn't a template
}

Should the constraint on opDispatch allow the UFCS "to" call on S?

That's a compiler bug.
http://d.puremagic.com/issues/show_bug.cgi?id=10526

Kenji Hara

Reply via email to