Mercurial > projects > dstress
annotate run/with_10.d @ 1619:bebc7472a832
Fix #7.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 07 Nov 2009 18:55:30 +0100 |
parents | f87ba6507260 |
children |
rev | line source |
---|---|
352 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
374 | 5 module dstress.run.with_10; |
352 | 6 |
16 | 7 MyClass dummyThis; |
8 | |
9 int value=1; | |
10 | |
11 class MyClass{ | |
352 | 12 |
13 this(){} | |
14 | |
16 | 15 int value=2; |
16 | |
17 void test(){ | |
18 dummyThis=this; | |
19 value=3; | |
20 with(new MyClass()){ | |
21 assert(value==2); | |
22 assert(this==dummyThis); | |
23 } | |
24 } | |
25 } | |
26 | |
27 int main(){ | |
28 MyClass c = new MyClass(); | |
29 c.test(); | |
30 return 0; | |
31 } |