[Issue 22113] Allow `noreturn` as a type for main function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 13 09:53:06 UTC 2021


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl

--- Comment #2 from Dennis <dkorpel at live.nl> ---
(In reply to Mathias LANG from comment #1)
> Does it make sense ?

Based on covariance of noreturn functions, I think so. `noreturn function(...)`
converts to `T function(...)` in general.

> What advantage can one derive from it over `void` ?

Smaller codegen, statically knowing the endless loop doesn't have any breaks.
Could be useful for embedded applications that are supposed to run forever
until the power is cut off.

--


More information about the Digitalmars-d-bugs mailing list