Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Jordan LeDoux
On Sun, Aug 15, 2021 at 4:06 PM Alexandru Pătrănescu wrote: > Hey Jordan, > > From type perspective, this sounds good. > > But, in my view, types should be checked statically. > For inheritance, when defining a method, both the parameters and return > types are nicely checked statically and

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Mike Schinkel
> On Aug 15, 2021, at 7:06 PM, Alexandru Pătrănescu wrote: > > If I see an interface that was created just so it can be implemented by > multiple classes but the caller doesn't use the interface but it uses the > actual classes, I call it out as that is the wrong abstraction and the > interface

Re: [PHP-DEV] [VOTE] Nullable intersection types

2021-08-15 Thread Patrick ALLAERT
Le lun. 16 août 2021 à 02:04, Tobias Nyholm a écrit : > > > On 15 Aug 2021, at 16:46, Patrick ALLAERT wrote: > > Le ven. 13 août 2021 à 11:35, Nicolas Grekas a > écrit : > > Hi everyone, > > I'm happy to announce that the vote for nullable intersection types is now > open: >

Re: [PHP-DEV] [VOTE] Nullable intersection types

2021-08-15 Thread Tobias Nyholm
Hey. > No mistake: the "pure intersection types" RFC was explicitly designed to > avoid scope creep (this RFC). Just because it was intentional, does not make it less of a mistake. I see that we have different views of this. And I understand that you are happy with this change, but only for

Re: [PHP-DEV] [VOTE] Nullable intersection types

2021-08-15 Thread Kalle Sommer Nielsen
> Hey Patrick. > > This has been discussed already. See https://externals.io/message/115554 > Only Joe replied in there, implying an OK, however Patrick is also an RM and if he raises a concern, then that is good grounds for concern as exceptions to the

Re: [PHP-DEV] [VOTE] Nullable intersection types

2021-08-15 Thread Marco Pivetta
Heyo, On Mon, 16 Aug 2021, 02:04 Tobias Nyholm, wrote: > It is to correct a mistake No mistake: the "pure intersection types" RFC was explicitly designed to avoid scope creep (this RFC).

Re: [PHP-DEV] [VOTE] Nullable intersection types

2021-08-15 Thread Tobias Nyholm
> On 15 Aug 2021, at 16:46, Patrick ALLAERT wrote: > > Le ven. 13 août 2021 à 11:35, Nicolas Grekas a > écrit : > >> Hi everyone, >> >> I'm happy to announce that the vote for nullable intersection types is now >> open: >> https://wiki.php.net/rfc/nullable_intersection_types >> >> It'll

Re: [PHP-DEV] [VOTE] Nullable intersection types

2021-08-15 Thread Patrick ALLAERT
Le ven. 13 août 2021 à 11:35, Nicolas Grekas a écrit : > Hi everyone, > > I'm happy to announce that the vote for nullable intersection types is now > open: > https://wiki.php.net/rfc/nullable_intersection_types > > It'll close in two weeks, on the 27th. > > Cheers, > Nicolas > Hi Nicolas, I

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Alexandru Pătrănescu
On Sat, Aug 14, 2021, 01:27 Jordan LeDoux wrote: > Hey internals, > > I've been working on the draft for my operator overloading RFC, and in > doing so I encountered a separate change that I would like to see. > > That is, the use of `never` as an argument type for interfaces. Since > arguments

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Lynn
On Sun, Aug 15, 2021 at 1:11 PM Jordan LeDoux wrote: > > So your intuition is correct. `foo(never $something)` will result in a > `TypeError` if you try to call it directly. The only way it can be called > is by being overridden with a wider type, which is why most of the focus is > around

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Jordan LeDoux
On Sun, Aug 15, 2021 at 3:43 AM Lynn wrote: > On Sat, Aug 14, 2021 at 1:27 AM Jordan LeDoux > 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

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Deleu
On Sun, Aug 15, 2021, 12:43 Lynn wrote: > 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.

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Lynn
On Sat, Aug 14, 2021 at 1:27 AM Jordan LeDoux 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

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Jordan LeDoux
On Sun, Aug 15, 2021 at 1:25 AM Ondřej Mirtes wrote: > It’s true that having “never” in a parameter type (please use “parameter” > name for the method declaration, “argument” is what you pass to a parameter > when you call the method) would allow to use any type in an overriding > method from

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Ondřej Mirtes
It’s true that having “never” in a parameter type (please use “parameter” name for the method declaration, “argument” is what you pass to a parameter when you call the method) would allow to use any type in an overriding method from contravariance/LSP point of view. But at the same time the