annotate run/bug_20050128_B.d @ 564:e77e4444c170

partial metadata fix
author thomask
date Thu, 02 Jun 2005 15:42:31 +0000
parents ee9d62b2a74f
children 52c9e86b6486
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
1 // $HeadURL$
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
2 // $Date$
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
3 // $Author$
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
4
564
e77e4444c170 partial metadata fix
thomask
parents: 256
diff changeset
5 // @author@ Nick <Nick_member@pathlink.com>
256
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
6 // @date@ 2005-01-28
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
7 // @uri@ news:ctdtgj$30r$1@digitaldaemon.com
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
8 // @url@ nntp://news.digitalmars.com/digitalmars.D.bugs/2784
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
9
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
10 module dstress.run.bug_20050128_B;
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
11
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
12 struct MyStruct{
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
13 int i;
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
14
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
15 void display(){
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
16 assert(i==10);
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
17 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
18
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
19 void someFunc(){
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
20 // We never call this function
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
21 void bug(MyStruct[] array){
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
22 // array[0].i = i+1; // Comment out this line and the bug goes away
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
23 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
24
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
25 assert(i==10);
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
26 display();
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
27 assert(i==10);
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
28 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
29 }
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
30
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
31 int main(){
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
32 MyStruct m;
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
33 m.i = 10;
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
34 assert(m.i==10);
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
35 m.someFunc();
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
36 assert(m.i==10);
ee9d62b2a74f inner function in struct member functions
thomask
parents:
diff changeset
37 return 0;
564
e77e4444c170 partial metadata fix
thomask
parents: 256
diff changeset
38 }