208
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Ilya Zaitseff <sark7@mail333.com>
|
|
6 // @date@ 2004-12-21
|
|
7 // @uri@ news:opsja8b9ddaaezs2@robingood
|
1487
|
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2584
|
208
|
9
|
|
10 module dstress.run.constructor_08;
|
|
11
|
|
12 class A{
|
|
13 this() {}
|
|
14 }
|
|
15
|
|
16 class B : A {
|
|
17 int foo;
|
516
|
18 this() {}
|
208
|
19 }
|
|
20
|
|
21 class C : B {
|
|
22 int bar;
|
|
23
|
|
24 this(){
|
|
25 foo = 0;
|
|
26 bar = 1;
|
|
27 }
|
|
28 }
|
|
29
|
|
30 int main(){
|
|
31 C c = new C();
|
|
32 assert(c.foo==0);
|
|
33 assert(c.bar==1);
|
|
34 c.foo=2;
|
|
35 assert(c.foo==2);
|
|
36 assert(c.bar==1);
|
|
37 c.bar=-1;
|
|
38 assert(c.foo==2);
|
|
39 assert(c.bar==-1);
|
|
40 return 0;
|
|
41 }
|