On 10.03.2021 20:28, Ben Ramsey wrote:
>> I don't like that type covariance would be allowed. Why such an
>> exception to the rules?
>
> It’s not an exception. Returns are covariant. Parameters are
> contravariant. Since noreturn is a subtype of all other types, it
> behaves as expected.
I see it's a subtype, I don't get why. Wouldn't it be better to be a
separate type so return type covariance is not allowed (as it is with
void)? Was it a design decision or a side product of the implementation?
--
Aleksander Machniak
Kolab Groupware Developer [https://kolab.org]
Roundcube Webmail Developer [https://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com