[Issue 13488] implicit conversions to immutable broken

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 18 02:21:04 PDT 2014


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

--- Comment #6 from Sobirari Muhomori <dfj1esp02 at sneakemail.com> ---
It feels like everything constructed in a strongly pure call can be implicitly
casted to immutable. A call to pure constructor can be seen as a call to pure
factory, so its result can be casted to immutable if the call is strongly pure.

This works:
---
int[] a() pure
{
    return new int[2];
}

void b()
{
    immutable int[] c = a();
}
---

--


More information about the Digitalmars-d-bugs mailing list