549
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Kris <fu@bar.com>
|
|
6 // @date@ 2005-05-20
|
1489
|
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=4081
|
549
|
8
|
|
9 module dstress.run.o.overload_23;
|
|
10
|
|
11 class Base{
|
|
12 package char[] name(){
|
|
13 return "base";
|
|
14 }
|
|
15 }
|
|
16
|
|
17 class Derived:Base{
|
|
18 package char[] name(){
|
1091
|
19 return "derived";
|
549
|
20 }
|
|
21 }
|
|
22
|
|
23 int main(){
|
|
24 Base b = new Base;
|
1086
|
25 if(b.name != "base"){
|
|
26 assert(0);
|
|
27 }
|
549
|
28
|
|
29 Derived d = new Derived;
|
1086
|
30 if(d.name != "derived"){
|
|
31 assert(0);
|
|
32 }
|
549
|
33
|
|
34 Base bd = new Derived;
|
1270
|
35 if(bd.name != "base"){
|
1086
|
36 assert(0);
|
|
37 }
|
549
|
38 return 0;
|
|
39 }
|