https://issues.dlang.org/show_bug.cgi?id=19925
Issue ID: 19925 Summary: static opDispatch not considered in WithStatement Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: simen.kja...@gmail.com The below code does not compile, but should: unittest { with (S) { a(); // Compiles! b(); // Fails! } } struct S { static void a() {} static void opDispatch(string name)() {} } To make it worse, this compiles: unittest { with (S.init) { a(); // Compiles! b(); // Compiles! } } , showing that static methods are considered when looking up methods of an instance. --