[Issue 23502] New: deeper recursive assertions fail to compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 21 16:50:47 UTC 2022


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

          Issue ID: 23502
           Summary: deeper recursive assertions fail to compile
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list