Re: [RFC] noreturn type

From: Date: Thu, 11 Mar 2021 07:24:58 +0000
Subject: Re: [RFC] noreturn type
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-113463@lists.php.net to get a copy of this message
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


Thread (37 messages)

« previous php.internals (#113463) next »