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

           Summary: Taking address of member functions possible without an
                    instance
           Product: D
           Version: 2.039
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: tomeks...@gmail.com


--- Comment #0 from Tomasz SowiƄski <tomeks...@gmail.com> 2010-01-18 15:04:35 
PST ---
struct S {
    int a;
    void fun() {
        this.a = 1;
    }
}

void main() {
    auto fp = &S.fun;
    fp();
}

Outputs:
object.Error: Access Violation


The solution is either to delegalize it or (better) include the hidden
parameter into the function pointer signature. So that &S.fun would be of type
void function(ref S).

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

Reply via email to