comparison run/with_02.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/with_02.d,v 1.1 2004/09/22 20:12:55 th Exp $
2
3 class MyClass{
4 int test(){
5 return 1;
6 }
7 }
8
9 class Check{
10 int test(){
11 return 2;
12 }
13
14 void check(){
15 MyClass object=new MyClass();
16 assert(test()==2);
17 with(object){
18 assert(test()==1);
19 assert(this.test()==2);
20 }
21 }
22 }
23
24 int test(){
25 return 0;
26 }
27
28 int main(){
29 Check o=new Check();
30 o.check();
31 return 0;
32 }