[Issue 14017] Assignment of a mutable array returned from non-`pure` function to `immutable` global variable is allowed

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 20 13:06:11 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14017

--- Comment #2 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
Note:
This issue is created as a result of Issue 7492 discussion.

(In reply to Steven Schveighoffer from comment #1)
> It's CTFE executed, so immutable is fine. Although I think it would be
> permissible for pure to be inferred here because of the auto return type.
> 
> The bug is the opposite -- it should allow the char[] array to also be
> assigned.

It's not a bug, it's a current language type system rules. See enhancement
Issue 14018 for language rules change request.

And please, don't mix another language change request about purity inference
because of `auto` return type in this issue.

--


More information about the Digitalmars-d-bugs mailing list