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_07;
|
|
11
|
|
12 class A{
|
|
13 this() {}
|
|
14 }
|
|
15
|
|
16 class B : A {
|
|
17 int foo;
|
|
18 }
|
|
19
|
|
20 class C : B {
|
|
21 int bar;
|
|
22
|
|
23 this(){
|
|
24 foo = 0;
|
|
25 bar = 1;
|
|
26 }
|
|
27 }
|
|
28
|
|
29 int main(){
|
|
30 C c = new C();
|
|
31 assert(c.foo==0);
|
|
32 assert(c.bar==1);
|
|
33 c.foo=2;
|
|
34 assert(c.foo==2);
|
|
35 assert(c.bar==1);
|
|
36 c.bar=-1;
|
|
37 assert(c.foo==2);
|
|
38 assert(c.bar==-1);
|
|
39 return 0;
|
|
40 }
|