https://issues.dlang.org/show_bug.cgi?id=19348
Nick Treleaven <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Nick Treleaven <[email protected]> --- Issue 20570 suggests the non-equivalency may be a bug. > 8. Casting a value v to a struct S, when v is not a struct of the same type, creates a rvalue of type S, with representation copied from v, with representation copied from v; no postblits/copy constructors are called; v.sizeof must be equal to S.sizeof. No constructor at all seems to be called, unlike for S(v). That wording would be better, but doesn't explain this error: struct S { int[2] i; } void main() { S s; s = cast(S) cast(short[4]) [10,0,20,0]; // OK s = cast(S) long.max; // error } Error: cannot cast expression `9223372036854775807L` of type `long` to `S` The sizes do match. --
