1437
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ <vlasov@scatt.com>
|
|
6 // @date@ 2007-03-12
|
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1058
|
|
8 // @desc@ [Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor
|
|
9
|
|
10 module dstress.run.f.forward_reference_19_C;
|
|
11
|
|
12 class A{
|
|
13 B x;
|
|
14
|
|
15 this(){
|
|
16 }
|
|
17
|
|
18 B b(){
|
|
19 return x;
|
|
20 }
|
|
21 }
|
|
22
|
|
23 struct B{
|
|
24 int dummy;
|
|
25 }
|
|
26
|
|
27 int main(){
|
|
28 A a = new A();
|
|
29 B b;
|
|
30 b.dummy = 0x12EF34AB;
|
|
31 a.x = b;
|
|
32 if(0x12EF34AB != a.b().dummy){
|
|
33 assert(0);
|
|
34 }
|
|
35
|
|
36 return 0;
|
|
37 }
|