[Issue 24021] Issue a warning on assert with side effects

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 29 13:27:27 UTC 2023


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

--- Comment #7 from Grim Maple <grimmaple95 at gmail.com> ---
With all due respect, this isn't a _duplicate_ of 12028. I'm not proposing to
disallow side effects, I'm proposing to notify user that their code was not
compiled.
I think this warning should be issued in release builds only, as they are the
only one affected. This will not affect unittests or bring other
inconveniences. Besides, maybe, rewriting code from `assert(foo())` to `auto
tmp = foo(); assert(tmp);`

--


More information about the Digitalmars-d-bugs mailing list