www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12209] New: Unable to take address of function nested function

https://d.puremagic.com/issues/show_bug.cgi?id=12209

           Summary: Unable to take address of function nested function
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: lt.infiltrator gmail.com



PST ---
----------------------------------------------------------
import std.functional : curry;

class S {
    this(S delegate()) { }
}

void main() {
    S fun(int foo) {
        auto ret = new S(&curry!(gun, foo));
        return ret;
    }

    S gun(int foo) {
        auto ret = new S(&curry!(fun, foo));
        return ret;
    };
}
---------------------------------------------------------
Fails to compile:

/d607/f459.d(9): Error: undefined identifier gun, did you mean function fun?
/d607/f459.d(9): Error: no constructor for S

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