Summary: arbitrary struct accepted as struct initializer
           Product: D
           Version: 1.035
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]

The following code compiles

struct Foo { double d; }
struct Bar { byte b; }
void main() { Foo foo; Bar bar = foo; }

even though Foo is not implicitly convertible to Bar. In contrast, assigning

Foo foo;
Bar bar;
bar = foo;

fails as expected.


Reply via email to