The with statement does not appear to take opDispatch into account: ---- struct Foo { string[string] strs; void opDispatch(string s, T)(T t) {} } void main() { Foo f; f.check(1); with(f) { check(2); } } ----- test.d(11): Error: undefined identifier check Using dmd 2.062.
This still happens in DMD 2.066.1 under Windows 7. It'd be nice to have this fixed, or otherwise resolved at least. See http://forum.dlang.org/thread/djxelqtyjyabrvzmtvto@forum.dlang.org for another test case, as well as a hack-y workaround.
*** This issue has been marked as a duplicate of issue 6400 ***