https://issues.dlang.org/show_bug.cgi?id=14017
Issue ID: 14017
Summary: Assignment of a mutable array returned from non-`pure`
function to `immutable` global variable is allowed
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
This code compiles but shouldn't:
---
auto f() { return new int[1]; }
immutable s = f(); // error only with character arrays
---
Also such code is currently rejected for arrays of characters.
--