[Issue 22384] castSwitch confused by noreturn handlers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 14 08:49:34 UTC 2021


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

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/phobos pull request #8270 "Fix 22384 - Treat noreturn handlers like void
in castSwitch" was merged into master:

- 3e70aac3ae35a26ec837ce5362711ed3bfece2ae by MoonlightSentinel:
  Fix 22384 - Treat noreturn handlers like void in castSwitch

  The previous check assumed that non-`void` return implies a returned
  value - which obviously does not apply for `noreturn`.
  Further code then assumed that `void` handlers should throw an exception
  and hence threw an error when it didn't throw.

https://github.com/dlang/phobos/pull/8270

--


More information about the Digitalmars-d-bugs mailing list