comparison run/scope_01.d @ 0:3269e4627918

init dstress
author svnowner
date Sat, 25 Sep 2004 22:33:30 +0000
parents
children 3414705c41ac
comparison
equal deleted inserted replaced
-1:000000000000 0:3269e4627918
1 // $Header: /home/th/Dokumente/Entwicklung/MEIN_CVS/MiniD/src/run/scope_01.d,v 1.1 2004/08/21 21:38:30 th Exp $
2
3 // @author@ J Anderson <REMOVEanderson@badmama.com.au>
4 // @date@ 2004-01-05
5 // @uri@ news://c70jk9$off$1@digitaldaemon.com
6
7 int check;
8
9 class MyClass{
10 this(){
11 status=3;
12 }
13
14 void call(){
15 assert(status==3);
16 s.test();
17 check+=5;
18 }
19
20 struct MyStruct{
21 void test(){
22 assert(status==3);
23 status=4;
24 check+=3;
25 }
26 }
27
28 MyStruct s;
29 int status;
30 }
31
32 int main(){
33 MyClass c = new MyClass();
34 assert(c.status==3);
35 assert(check==0);
36 c.call();
37 assert(c.status==4);
38 assert(check==8);
39 return 0;
40 }