www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23502] New: deeper recursive assertions fail to compile

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 puremagic.com
          Reporter: elpenguino+D 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.

--
Nov 21 2022