Mercurial > projects > dstress
comparison run/super_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/super_01.d,v 1.1 2004/08/21 20:44:50 th Exp $ | |
2 | |
3 int status; | |
4 | |
5 class Parent{ | |
6 void test(){ | |
7 status++; | |
8 } | |
9 } | |
10 | |
11 class Child : Parent { | |
12 void test(){ | |
13 assert(status==0); | |
14 super.test(); | |
15 assert(status==1); | |
16 } | |
17 } | |
18 | |
19 int main(){ | |
20 Child c = new Child(); | |
21 c.test(); | |
22 assert(status==1); | |
23 return 0; | |
24 } | |
25 |