Bug 23502 – deeper recursive assertions fail to compile

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-11-21T16:50:47Z
Last change time
2024-12-13T19:25:49Z
Assigned to
No Owner
Creator
elpenguino+D
Moved to GitHub: dmd#20189 →

Comments

Comment #0 by elpenguino+D — 2022-11-21T16:50:47Z
this code: ``` void main() { assert(assert(0, "hello"), "hello again"); // ok assert(assert(assert(0, "hello once again"), "hello"), "hello again"); //error } ``` produces an unexpected error: `Error: expression `assert(assert(0, "hello once again"), "hello")` of type `void` does not have a boolean value` Since assert is supposed to be typed noreturn, this should compile.
Comment #1 by dkorpel — 2022-11-21T17:51:59Z
> Since assert is supposed to be typed noreturn That's not true in general, only if the condition evaluates at compile time to `false`.
Comment #2 by robert.schadek — 2024-12-13T19:25:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20189 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB