595
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Victor Nakoryakov <nail-mail@mail.ru>
|
|
6 // @date@ 2005-06-25
|
1489
|
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=4396
|
595
|
8
|
|
9 module dstress.run.i.inline_11_A;
|
1091
|
10
|
595
|
11 struct Struct{
|
|
12 int i;
|
|
13
|
|
14 Struct foo(){
|
|
15 Struct s;
|
|
16 int a = i;
|
1091
|
17 int b = s.i;
|
595
|
18 with (s) {
|
|
19 i+=2;
|
|
20 }
|
|
21 assert(a==i);
|
|
22 assert(b+2==s.i);
|
|
23 return s;
|
|
24 }
|
|
25
|
|
26 Struct bar(){
|
|
27 return Struct.foo() * Struct.foo();
|
|
28 }
|
|
29
|
|
30 Struct opMul(Struct s){
|
|
31 Struct ss;
|
|
32 ss.i = s.i * i;
|
|
33 return ss;
|
|
34 }
|
|
35 }
|
|
36
|
|
37 int main(){
|
|
38 Struct s;
|
|
39 assert(s.bar().i==4);
|
1091
|
40 return 0;
|
595
|
41 }
|