374
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 module dstress.run.with_03;
|
0
|
6
|
|
7 class MyClass{
|
|
8 int test(){
|
|
9 return 1;
|
|
10 }
|
|
11 }
|
|
12
|
|
13 class Parent{
|
|
14 int test(){
|
|
15 return 3;
|
|
16 }
|
|
17 }
|
|
18
|
|
19 class Check : Parent{
|
|
20 int test(){
|
|
21 return 2;
|
|
22 }
|
|
23
|
|
24 void check(){
|
|
25 MyClass object=new MyClass();
|
|
26 assert(test()==2);
|
|
27 with(object){
|
|
28 assert(test()==1);
|
|
29 assert(super.test()==3);
|
|
30 }
|
|
31 }
|
|
32 }
|
|
33
|
|
34 int test(){
|
|
35 return 0;
|
|
36 }
|
|
37
|
|
38 int main(){
|
|
39 Check o=new Check();
|
|
40 o.check();
|
|
41 return 0;
|
|
42 }
|