Mercurial > projects > dstress
annotate run/s/scope_21_A.d @ 1615:8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 12 Jul 2009 16:44:52 +0200 |
parents | run/a/auto_14_A.d@902d2c168029 |
children |
rev | line source |
---|---|
799 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Sean Kelly <sean@f4.ca> | |
6 // @date@ 2006-01-24 | |
7 // @uri@ news:dr5uqg$2hn7$1@digitaldaemon.com | |
1380 | 8 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=704 |
799 | 9 |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1380
diff
changeset
|
10 module dstress.run.s.scope_21_A; |
799 | 11 |
12 bool hadDtor = false; | |
13 | |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1380
diff
changeset
|
14 scope class MyClass{ |
799 | 15 this(){ |
16 throw new Exception("dummy"); | |
17 } | |
18 | |
19 ~this(){ | |
20 hadDtor = true; | |
21 throw new Exception("should never throw"); | |
22 } | |
23 } | |
24 | |
25 int main(){ | |
26 try{ | |
1615
8d5c55d163fd
Fix some outdated tests that used auto to mean scope.
Christian Kamm <kamm incasoftware de>
parents:
1380
diff
changeset
|
27 scope MyClass c; |
799 | 28 c = new MyClass(); |
29 }catch{ | |
30 if(!hadDtor){ | |
31 return 0; | |
32 }else{ | |
33 assert(0); | |
34 } | |
35 } | |
36 | |
37 assert(0); | |
38 } |