[Issue 815] New: scope(exit) isn't executed when "continue" is used to continue a while-loop
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 7 16:05:29 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=815
Summary: scope(exit) isn't executed when "continue" is used to
continue a while-loop
Product: D
Version: 1.00
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P3
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: thomas-dloop at kuehne.cn
# import std.stdio;
#
# void main(){
# int i = 3;
# while(i--){
# scope(exit) writefln("scope(exit)");
# writefln("i: %s", i);
# if(i % 2) continue;
# }
#
# writefln("---");
#
# i = 3;
# while(i--){
# scope(success) writefln("scope(success)");
# writefln("i: %s", i);
# if(i % 2) continue;
# }
#
# }
output:
> i: 2
> scope(exit)
> i: 1
> i: 0
> scope(exit)
> ---
> i: 2
> scope(success)
> i: 1
> scope(success)
> i: 0
> scope(success)
expected output:
> i: 2
> scope(exit)
> i: 1
> scope(exit)
> i: 0
> scope(exit)
> ---
> i: 2
> scope(success)
> i: 1
> scope(success)
> i: 0
> scope(success)
--
More information about the Digitalmars-d-bugs
mailing list