http://d.puremagic.com/issues/show_bug.cgi?id=3452

           Summary: Can't alias member functions such that the object name
                    is implicitly stored in the alias
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha <dsim...@yahoo.com> 2009-10-29 14:00:43 PDT ---
struct Foo {
    void bar() {}
    void baz() {}
}

void doStuff(Foo foo) {
    alias foo.bar fun;
    fun();  //  Error: need 'this' to access member bar
}

I can't think of any reason why this shouldn't work.  foo.bar is a compile-time
symbol for the member function Foo.bar() on the instance foo.  Once I alias
foo.bar to fun, calling fun() should be equivalent to calling foo.bar().

Even if there's some language legalese reason why this shouldn't work according
to the spec, it's still a reasonable enhancement request.

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

Reply via email to