July 29, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6400

           Summary: opDispatch with WithStatement
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: zan77137@nifty.com


--- Comment #0 from SHOO <zan77137@nifty.com> 2011-07-29 08:31:01 PDT ---
Following code doesn't work:
----------------------------
import std.stdio;

class Foo
{
    void opDispatch(string name)()
    {
        writeln(name);
    }
}

void main()
{
    auto foo = new Foo;
    with (foo)
    {
        bar();
    }
}
----------------------------
Result:
$ dmd -run main
main.d(16): Error: undefined identifier bar

----------------------------


According to the specifications, WithStatement should be interpreted as follows:
----
with (foo)
{
    bar();
}
---- is semantically equivalent to:
Foo tmp = foo;
tmp.bar();
---- is semantically equivalent to:
Foo tmp = foo;
tmp.opDispatch!("bar")();
----

It is incorrect behavior and is a bug. And another thing, this syntax is simply convenient if I could use opDispatch in WithStatement.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 26, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6400


SomeDude <lovelydear@mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear@mailmetrash.com


--- Comment #1 from SomeDude <lovelydear@mailmetrash.com> 2012-04-26 09:50:39 PDT ---
Not working on 2.059

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------