[Issue 4733] Possible bugs caused by dynamic arrays in boolean evaluation context

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 22 13:52:39 UTC 2023


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

--- Comment #41 from Steven Schveighoffer <schveiguy at gmail.com> ---
I would vote for `if(arr)` to be true only if length > 0, instead of making it
illegal.

But some people do distinguish between null arrays and empty arrays, and this
would be a breaking change for that code.

> I still think it would be good to do for editions.

Yes, please! If editions ever becomes a thing, this should be considered.

--


More information about the Digitalmars-d-bugs mailing list