[Issue 1350] delegate literal inside tuple; wrong values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 22 02:26:24 PDT 2010


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|delegate inside tuple;      |delegate literal inside
                   |wrong values                |tuple; wrong values


--- Comment #5 from Don <clugdbug at yahoo.com.au> 2010-07-22 02:26:16 PDT ---
This is happening because the delegate literal is passed as an alias template
parameter. This parameter never gets resolved properly. In the example below,
the compiler thinks that the parent of the delegate literal is 'Goat', whereas
the true parent is 'main'. The problem might be in TupleExp::semantic(): if an
element of the tuple is a symbol, maybe it should be attempting to resolve it.

--------
void Goat(Callbacks ...)() {
    Callbacks[0](333); // fails
}

void main() {
    Goat!(
        (int i) { assert(i==333); } 
    )();
}

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