Bug 661 – Error using a zero-init struct's init property

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2006-12-06T21:51:00Z
Last change time
2014-02-15T13:19:29Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
dvdfrdmn

Comments

Comment #0 by dvdfrdmn — 2006-12-06T21:51:51Z
--- struct X { int x; } void main() { X x; x = x.init; } --- Compiling yields: Error: cannot implicitly convert expression (0) of type int to X
Comment #1 by thomas-dloop — 2006-12-07T05:05:44Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-12-07: > http://d.puremagic.com/issues/show_bug.cgi?id=661 > --- > struct X { int x; } > void main() > { > X x; > x = x.init; > } > --- > Compiling yields: Error: cannot implicitly convert expression (0) of type int > to X Added to DStress as http://dstress.kuehne.cn/run/s/struct_initialization_08_A.d http://dstress.kuehne.cn/run/s/struct_initialization_08_B.d http://dstress.kuehne.cn/run/s/struct_initialization_08_C.d http://dstress.kuehne.cn/run/s/struct_initialization_08_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFd/p2LK5blCcjpWoRAoPmAJ0WkQjHD+t0Mlw89L99In5p9FEYbACfQ6BC ajDLqvHiKnSk31FKpg55UdM= =26Hd -----END PGP SIGNATURE-----
Comment #2 by bugzilla — 2006-12-27T02:01:29Z
Fixed DMD 0.178