D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9808 - with statement does not work with opDispatch
Summary: with statement does not work with opDispatch
Status: RESOLVED DUPLICATE of issue 6400
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-03-24 06:33 UTC by Robert Clipsham
Modified: 2015-06-09 01:31 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Robert Clipsham 2013-03-24 06:33:12 UTC
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 Alex Parrill 2015-02-06 02:44:00 UTC
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.
Comment 2 yebblies 2015-02-06 05:17:53 UTC

*** This issue has been marked as a duplicate of issue 6400 ***