Re: [RFC] Never For Argument Types
| From: | Lynn | Date: | Sun, 15 Aug 2021 10:43:21 +0000 |
| Subject: | Re: [RFC] Never For Argument Types | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115736@lists.php.net to get a copy of this message | ||
On Sat, Aug 14, 2021 at 1:27 AM Jordan LeDoux <jordan.ledoux@gmail.com>
wrote:
>
> Any feedback is greatly appreciated.
>
https://github.com/JordanRL/never-argument-type
My only feedback is that it should not be called
never. If I see never
as the parameter type, I read this as never being allowed to pass anything,
which means that foo('something') with foo(never $something)
will
result in a compile error. The type never only makes sense from a return
type perspective: "Should it return? never". Perhaps any or
anything
makes more sense? I've also seen a suggestion to name it abstract, and
maybe there are more suggestions I've missed. To me it also sounds like the
goal of never as a parameter type is different from the return type. From
my understanding one indicates that a type is required, while the other
indicates that nothing ever returns, giving it the same name is confusing.
Apologies for sending this message twice to you Jordan, reply to all is not
my default reply button.