Bug 9808 – with statement does not work with opDispatch

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-24T06:33:00Z
Last change time
2015-06-09T01:31:18Z
Keywords
rejects-valid
Assigned to
nobody
Creator
robert
See also
http://d.puremagic.com/issues/show_bug.cgi?id=9807

Comments

Comment #0 by robert — 2013-03-24T06:33:12Z
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 ***