annotate run/s/scope_17_B.d @ 1455:a4dc53fd9f2e

[Issue 1087] Scope classes not destroyed in labeled statements in switches Jarrett Billingsley <jarrett.billingsley@gmail.com> 2007-03-30 http://d.puremagic.com/issues/show_bug.cgi?id=1087
author thomask
date Thu, 05 Apr 2007 10:18:36 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1455
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
1 // $HeadURL$
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
2 // $Date$
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
3 // $Author$
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
4
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
5 // @author@ Jarrett Billingsley <jarrett.billingsley@gmail.com>
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
6 // @date@ 2007-03-30
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1087
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
8 // @desc@ [Issue 1087] Scope classes not destroyed in labeled statements in switches
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
9
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
10 module dstress.run.s.scope_17_B;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
11
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
12 int i[];
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
13
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
14 scope class A{
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
15 ~this(){
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
16 i ~= 3;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
17 }
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
18 }
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
19
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
20 int main(){
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
21 i ~= 0;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
22
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
23 switch(i.length)
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
24 {
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
25 case 1:
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
26 scope a = new A();
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
27 scope(exit) i ~= 2;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
28 i ~= 1;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
29 break;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
30 }
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
31 i ~= 4;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
32
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
33 if([0, 1, 2, 3, 4] != i){
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
34 assert(0);
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
35 }
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
36
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
37 return 0;
a4dc53fd9f2e [Issue 1087] Scope classes not destroyed in labeled statements in switches
thomask
parents:
diff changeset
38 }