comparison run/d/delegate_20_B.d @ 1278:b644bef333ff

[Issue 500] New: Cannot assign to delegate during definition Marsell <marsell_pk@yahoo.com> 2006-11-13 news:bug-500-3@http.d.puremagic.com/issues/
author thomask
date Sat, 23 Dec 2006 19:47:26 +0000
parents
children daef239f37cf
comparison
equal deleted inserted replaced
1277:06c7337c4bd6 1278:b644bef333ff
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 // @author@ Marsell <marsell_pk@yahoo.com>
6 // @date@ 2006-11-13
7 // @uri@ news:bug-500-3@http.d.puremagic.com/issues/
8 // @desc@ [Issue 500] New: Cannot assign to delegate during definition
9
10 module dstress.run.d.delegate_20_B;
11
12 int main(){
13 int i;
14
15 int delegate() dg = { return ++i; };
16
17 if(dg() != 1){
18 assert(0);
19 }
20 if(dg() != 2){
21 assert(0);
22 }
23 if(i != 2){
24 assert(0);
25 }
26
27 return 0;
28 }