Thread overview
[Issue 303] New: delegate in finally
Aug 21, 2006
d-bugmail
Aug 21, 2006
d-bugmail
Aug 25, 2006
Thomas Kuehne
Sep 19, 2006
d-bugmail
August 21, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=303

           Summary: delegate in finally
           Product: D
           Version: 0.165
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: benoit@tionex.de


int func2( char[] msg ){
    return 1;
}

int func( char[] delegate() dg ){
    return func2( dg() );
}

void main(){
    try{
    }
    finally{
        func(); // line 14
    }
}
compiled with dmd 0.165 =>
t.d(14): function t.func (char[] delegate()) does not match argument types ()
t.d(14): Error: expected 1 arguments, not 0


-- 

August 21, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=303





------- Comment #1 from benoit@tionex.de  2006-08-21 09:09 -------
Sorry pasted the wrong snippet... Now the correct one :)

int func2( char[] msg ){
    return 1;
}

int func( char[] delegate() dg ){
    return func2( dg() );
}

void main(){
    try{
    }
    finally{
        func(""); // line 14
    }
}
compiled with dmd 0.165 =>
t.d(14): return statements cannot be in finally, scope(exit) or scope(success)
bodies


-- 

August 25, 2006
d-bugmail@puremagic.com schrieb am 2006-08-21:
> http://d.puremagic.com/issues/show_bug.cgi?id=303

> ------- Comment #1 from benoit@tionex.de  2006-08-21 09:09 -------
> Sorry pasted the wrong snippet... Now the correct one :)
>
> int func2( char[] msg ){
>     return 1;
> }
>
> int func( char[] delegate() dg ){
>     return func2( dg() );
> }
>
> void main(){
>     try{
>     }
>     finally{
>         func(""); // line 14
>     }
> }
> compiled with dmd 0.165 =>
> t.d(14): return statements cannot be in finally, scope(exit) or scope(success)
> bodies

Added to DStress as http://dstress.kuehne.cn/run/f/finally_11_A.d

Thomas


September 19, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=303


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from bugzilla@digitalmars.com  2006-09-19 15:26 -------
Fixed in DMC 0.167.


--