[Issue 9540] Compiler crash on delegate context frame assignment

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 20 05:27:25 PST 2013


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



--- Comment #4 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-02-20 05:27:24 PST ---
Reduced:

module failure;

template Tuple(E...) { alias E Tuple; }
alias Tuple!(int) Args;

void main() {
    (new A).test ();
}

void test1 (int delegate (int) f) { f (-2); }

class A
{
    int f (int a) {
        return a;
    }

    void test () {
        test1 (&AddFront!(this, f));
    }
}

template AddFront (alias ctx, alias fun)  {
    auto AddFront(Args args) {
        auto dg (Args dgArgs) {
            return fun (dgArgs);
        }
        dg.ptr = ctx;
        return dg(args);
    }
}

-- 
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