[Issue 15862] dmd thinks functions are strongly pure despite mutable indirections in the return type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 5 07:22:45 PDT 2016


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

--- Comment #5 from ag0aep6g at gmail.com ---
(In reply to anonymous4 from comment #4)
> Proper test case:
> 
> int[] a=f();
> int[] b=f();
> a[0]=0;
> b[0]=1;
> assert(a[0]==0 && b[0]==1);

You can't use asserts (except for assert(false)) to test this. The bug needs
-release to occur, and -release disables asserts.

--


More information about the Digitalmars-d-bugs mailing list