[Issue 22384] castSwitch confused by noreturn handlers
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 13 15:35:48 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22384
Dlang Bot <dlang-bot at dlang.rocks> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |pull
--- Comment #1 from Dlang Bot <dlang-bot at dlang.rocks> ---
@MoonlightSentinel created dlang/phobos pull request #8270 "Fix 22384 - Treat
noreturn handlers like void in castSwitch" fixing this issue:
- 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