[Issue 3995] Can't access array/AA from function literal defined inside the array/AA's initializer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 20 12:48:28 PDT 2010


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



--- Comment #1 from Nick Sabalausky <cbkbbejeap at mailinator.com> 2010-03-20 12:48:27 PDT ---
The above example might have a problem inferring the return type of the
delegate literals (and therefore the type of 'dgMap' itself). But this
alteration doesn't have that problem and still fails to compile with "undefined
identifier dgMap":

---------------------
auto dgMap = [
    "foo": delegate int(int i) {
        if(i < 1)
            return 0;
        else
            return dgMap["foo"](i-1);
    },

    "bar": delegate int(int i) {
        return dgMap["foo"](7);;
    }
];
---------------------

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


More information about the Digitalmars-d-bugs mailing list