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

--- Comment #0 from HOSOKAWA Kenchi <> 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!

Is this a duplicate of another reported issue?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to