www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 303] New: delegate in finally

reply d-bugmail puremagic.com writes:
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


-- 
Aug 21 2006
next sibling parent reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=303






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


-- 
Aug 21 2006
parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

 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 -----BEGIN PGP SIGNATURE----- iD8DBQFE7u4eLK5blCcjpWoRAs3KAKCZLl4aVVHIohMFSEA8ae3PROZDNwCeIlLU P35UA1cikVwJdFxtlSW8+Vo= =j7Qx -----END PGP SIGNATURE-----
Aug 25 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=303


bugzilla digitalmars.com changed:

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





Fixed in DMC 0.167.


-- 
Sep 19 2006