338
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // Static constructors within a module are executed in the lexical order in which they appear.
|
|
6
|
|
7 module dstress.run.constructor_10;
|
|
8
|
|
9 bool init;
|
|
10 bool initA;
|
|
11 bool initB;
|
|
12
|
|
13 static this(){
|
|
14 assert(!init);
|
|
15 assert(!initA);
|
|
16 assert(!initB);
|
|
17 init=true;
|
|
18 }
|
|
19
|
|
20 class B{
|
|
21 static this(){
|
|
22 assert(init);
|
|
23 assert(!initA);
|
|
24 assert(!initB);
|
|
25 initB=true;
|
|
26 }
|
|
27 }
|
|
28
|
|
29 class A{
|
|
30 static this(){
|
|
31 assert(init);
|
|
32 assert(!initA);
|
|
33 assert(initB);
|
|
34 initA=true;
|
|
35 }
|
|
36 }
|
|
37
|
|
38 int main(){
|
|
39 assert(init);
|
|
40 assert(initA);
|
|
41 assert(initB);
|
|
42 return 0;
|
|
43 }
|