http://d.puremagic.com/issues/show_bug.cgi?id=3302
Summary: Sloppy type check in dynamic initialization of struct Product: D Version: 2.032 Platform: All OS/Version: All Status: NEW Keywords: accepts-invalid Severity: critical Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: hs...@inter7.jp --- Comment #0 from HOSOKAWA Kenchi <hs...@inter7.jp> 2009-09-05 19:14:18 PDT --- struct S { int a; } struct T { real a=2; } T t; S s = t; // no compile-time or runtime error std.stdio.writeln(s.a); // -> 0 Probably this issue is due to excess-optimization. The issue is highly critical because it leave a kind of difficult-to-find problem in the compiled binary. Besides, strong-typed enum work well. enum E { a } enum F { a } E e = F.a; // of course compile-time error! P.S. Is this a duplicate of another reported issue? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------