# HG changeset patch # User thomask # Date 1165488502 0 # Node ID e8cc5e77c45766d0e203a3ad04f7c7e8cad57df7 # Parent b20a245f2238035f4eef3b45d843908d65f97458 [Issue 661] New: Error using a zero-init struct's init property David Friedman 2006-12-07 news:bug-661-3@http.d.puremagic.com/issues/ diff -r b20a245f2238 -r e8cc5e77c457 run/s/struct_initialization_08_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/struct_initialization_08_A.d Thu Dec 07 10:48:22 2006 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David Friedman +// @date@ 2006-12-07 +// @uri@ news:bug-661-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 661] New: Error using a zero-init struct's init property + +module dstress.run.s.struct_initialization_08_A; + +struct S { + int x = 0x12_34_AF_D1; +} + +int main() { + S s; + s.x = 1; + + s = s.init; + + if(s.x != 0x12_34_AF_D1){ + assert(0); + } + + return 0; +} diff -r b20a245f2238 -r e8cc5e77c457 run/s/struct_initialization_08_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/struct_initialization_08_B.d Thu Dec 07 10:48:22 2006 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David Friedman +// @date@ 2006-12-07 +// @uri@ news:bug-661-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 661] New: Error using a zero-init struct's init property + +module dstress.run.s.struct_initialization_08_B; + +struct S { + float x = 12.34f; +} + +int main() { + S s; + s.x = 1.0f; + + s = s.init; + + if(s.x != 12.3f){ + assert(0); + } + + return 0; +} diff -r b20a245f2238 -r e8cc5e77c457 run/s/struct_initialization_08_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/struct_initialization_08_C.d Thu Dec 07 10:48:22 2006 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David Friedman +// @date@ 2006-12-07 +// @uri@ news:bug-661-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 661] New: Error using a zero-init struct's init property + +module dstress.run.s.struct_initialization_08_C; + +struct S { + float x = 12.34f; +} + +int main() { + S s; + s.x = 1.0f; + + s = S.init; + + if(s.x != 12.3f){ + assert(0); + } + + return 0; +} diff -r b20a245f2238 -r e8cc5e77c457 run/s/struct_initialization_08_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/struct_initialization_08_D.d Thu Dec 07 10:48:22 2006 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ David Friedman +// @date@ 2006-12-07 +// @uri@ news:bug-661-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 661] New: Error using a zero-init struct's init property + +module dstress.run.s.struct_initialization_08_D; + +struct S { + int x = 0x12_34_AF_D1; +} + +int main() { + S s; + s.x = 1; + + s = S.init; + + if(s.x != 0x12_34_AF_D1){ + assert(0); + } + + return 0; +}