[Issue 13468] std.algorithm.canFind(null) fails with class
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Oct 1 21:36:03 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13468
--- Comment #2 from hsteoh at quickfur.ath.cx ---
Actually it's quite simple. The expression a == b, in the case of classes, is
lowered into a.opEquals(b). Since a is null when find/canFind gets to a null
element in the array, opEquals is invoked with a null this pointer, with
disastrous consequences.
--
More information about the Digitalmars-d-bugs
mailing list