Mercurial > projects > dstress
comparison run/f/forward_reference_19_C.d @ 1437:e489e020a55d
r7385@birke: tk | 2007-03-29 15:34:13 +0200
[Issue 1058] DMD hangs with 100% CPU - member function returning forward-referenced struct before constructor
<vlasov@scatt.com>
2007-03-12
http://d.puremagic.com/issues/show_bug.cgi?id=1058
author | thomask |
---|---|
date | Sat, 31 Mar 2007 08:24:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1436:a44492981ddb | 1437:e489e020a55d |
---|---|
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 } |