Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #240 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

scope(exit) and similar are inserted in nested functions

Reported by: fvbommel Assigned to: ChristianK
Priority: major Milestone:
Component: unspecified Version: hg tip
Keywords: Cc:

Description

See comments:

module test;

extern(C) int printf(char*, ...);

void caller(void delegate() dg) { dg(); }

void main(char[][] args) {
    // Uncomment the following line for an LLVM verifier error.
    //scope o = new Object;
    
    scope(exit) {
        // is printed twice, once from main and once from the delegate!
        printf("Exiting block\n");
    }
    caller({ return; });
}

Similar things happen with foreach blocks (and probably finally {} blocks too, given how this stuff works). Similar things happen

Change History

03/26/09 13:47:15 changed by lindquist

  • status changed from new to closed.
  • resolution set to fixed.

fixed in rev [1145]

Copyright © 2008, LDC Development Team.