Bug 466 – dmd prevent this from link, if so please prevent it from compiling

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-10-28T03:51:00Z
Last change time
2014-02-15T13:21:48Z
Keywords
link-failure
Assigned to
bugzilla
Creator
davidl

Comments

Comment #0 by davidl — 2006-10-28T03:51:58Z
import std.stdio; class Exception { char[] Exception; } void caller() { int count=0; void func(lazy char [] errormessage) // if it can be a nested func inside the caller would be nice { count++; if (count<3) { throw new Exception(errormessage); } } try { delete_directory("/home/someuser") ; } catch { }; } void delete_directory(char [] dirname) { // caller.func("hurray"); // caller.func("hurray"); // caller.func("hurray"); } void main() { caller(); } and the example code here is trying to interact with the try block owner i hope compiler would be able to generate the func in the example. like we have code import std.stdio; class Exception { char[] Exception; } void caller() { int count=0; try { delete_directory("/home/someuser") ; } catch { count++; if (count<3) { continue; // i want that to continue the point where throw the exception } }; } void delete_directory(char [] dirname) { throw new Exception("File1"); // maybe we can add a keyword like action, to let the try block to determine how to deal with the action, then we won't affect the exception we have now; throw new Exception("File2"); throw new Exception("File3"); // caller.func("hurray"); // caller.func("hurray"); // caller.func("hurray"); } void main() { caller(); }
Comment #1 by thomas-dloop — 2006-11-08T09:39:29Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-10-28: > http://d.puremagic.com/issues/show_bug.cgi?id=466 > import std.stdio; > class Exception > { > char[] Exception; > } <snip> Added to DStress as http://dstress.kuehne.cn/compile/m/mangleof_17_A.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFUfcsLK5blCcjpWoRAnmyAJwOyYexZ0ZwslTbYboDtm6VbyBN2gCdEtOf p/KEQO2mO2akZVGNcd9rlDU= =9Phy -----END PGP SIGNATURE-----
Comment #2 by bugzilla — 2006-11-25T03:55:19Z
Fixed DMD 0.175