Bug 303 – delegate in finally

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-08-21T09:05:00Z
Last change time
2014-02-15T13:20:16Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
benoit

Comments

Comment #0 by benoit — 2006-08-21T09:05:13Z
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
Comment #1 by benoit — 2006-08-21T09:09:40Z
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
Comment #2 by thomas-dloop — 2006-08-25T06:55:36Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-08-21: > http://d.puremagic.com/issues/show_bug.cgi?id=303 > ------- Comment #1 from [email protected] 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 -----BEGIN PGP SIGNATURE----- iD8DBQFE7u4eLK5blCcjpWoRAs3KAKCZLl4aVVHIohMFSEA8ae3PROZDNwCeIlLU P35UA1cikVwJdFxtlSW8+Vo= =j7Qx -----END PGP SIGNATURE-----
Comment #3 by bugzilla — 2006-09-19T15:26:52Z
Fixed in DMC 0.167.