Mercurial > projects > dstress
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/d/delegate_20_B.d Sat Dec 23 19:47:26 2006 +0000 @@ -0,0 +1,28 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Marsell <marsell_pk@yahoo.com> +// @date@ 2006-11-13 +// @uri@ news:bug-500-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 500] New: Cannot assign to delegate during definition + +module dstress.run.d.delegate_20_B; + +int main(){ + int i; + + int delegate() dg = { return ++i; }; + + if(dg() != 1){ + assert(0); + } + if(dg() != 2){ + assert(0); + } + if(i != 2){ + assert(0); + } + + return 0; +}