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.
Comment #1 by initrd.gz — 2015-02-06T02:44:00Z
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/[email protected] for another test case, as well as a hack-y workaround.
Comment #2 by yebblies — 2015-02-06T05:17:53Z
*** This issue has been marked as a duplicate of issue 6400 ***