www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22386] New: Unreachable warning for assertThrown with

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

          Issue ID: 22386
           Summary: Unreachable warning for assertThrown with noreturn
                    value
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: moonlightsentinel disroot.org

Passing a noreturn value to assertThrown triggers an unreachable statement
warning, e.g.

noreturn throwEx() { throw new Exception(""); }
assertThrown(throwEx());

std/exception.d(297): Warning: statement is not reachable

--
Oct 14 2021