On 10/5/2017 4:26 AM, Timon Gehr wrote:
UFCS allows hijacking. For an example, see:
https://github.com/tgehr/d-compiler/pull/1#discussion-diff-89697186L85

That may be a bug in the compiler. Can you produce a small test case?

struct S{
     // string foo(){ return "hijacked!"; } // uncomment to hijack
}

string foo(S s){ return "not hijacked!"; }

void main(){
     S s;
     import std.stdio;
     writeln(s.foo());
}

Thank you:

 https://issues.dlang.org/show_bug.cgi?id=17879

Reply via email to