Mercurial > projects > dstress
annotate run/typeof_04.d @ 1597:8b9d4d2f925a
Fix typos in complex tests. See D bug 614.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 09 Sep 2008 16:53:58 +0200 |
parents | f87ba6507260 |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.typeof_04; | |
0 | 6 |
7 class A { | |
8 int value(){ | |
9 return 'A'; | |
10 } | |
11 } | |
12 | |
13 class B : A { | |
14 int value(){ | |
15 return 'B'; | |
16 } | |
17 | |
18 typeof(super) a; // y is declared to be an A | |
19 typeof(this) b; // x is declared to be a B | |
20 | |
21 this(){ | |
22 a = new A(); | |
23 //b = new B(); | |
24 } | |
25 } | |
26 | |
27 int main(){ | |
28 B b = new B(); | |
29 | |
30 assert(b.value == 'B'); | |
31 assert(b.a.value == 'A'); | |
32 //assert(b.b.value == 'B'); | |
33 | |
34 return 0; | |
1 | 35 } |