[Issue 4463] [AA] double.init in associative array seems 0.0
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Aug 27 18:34:04 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=4463
dlang at croco-puzzle.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dlang at croco-puzzle.com
--- Comment #5 from dlang at croco-puzzle.com ---
In my oppinion aa[0]++ should behave exactly the same as aa[0] = aa[0]+1.
Therefore in my oppinion a correct unittest would be:
unittest
{
import std.exception: assertThrown;
import core.exception: RangeError;
double[int] aa;
assertThrown!RangeError(aa[0]++);
}
(At the moment with dmd v2.082.0 this leads to a segmentation fault, while
with ldc2 1.12.0 and gdc 8.3.0 I get the expected "assertThrown failed".)
--
More information about the Digitalmars-d-bugs
mailing list