https://issues.dlang.org/show_bug.cgi?id=19095
Issue ID: 19095 Summary: Static initiatization statements of an array appeared in different kind of scopes have inconsistent semantics Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: trivial Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: kub...@gmail.com I think this is not a bug, but it seems like unnatural behavior. --- auto foo() { return [1]; } int[2] ARR = [1]; int[2] ARR_2 = foo(); // Error: mismatched array lengths, 2 and 1 void main() { assert(ARR == [1, 0]); // Success. int[2]arr = [1]; // Error: mismatched array lengths, 2 and 1 } --- --