Re: [PHP-DEV] Make Closure covariant to callable

2024-11-15 Thread Levi Morrison
> > There are some weird cases with `callable` which is why they aren't > > allowed as a property type. I don't remember all the edges, but if we > > are sure that we cannot hit those with simple co-/contra-variance, > > then I don't think this needs an RFC and we can just merge the PR. > > The rea

Re: [PHP-DEV] Make Closure covariant to callable

2024-11-13 Thread Gina P. Banyard
On Wednesday, 13 November 2024 at 00:46, Levi Morrison wrote: > There are some weird cases with `callable` which is why they aren't > allowed as a property type. I don't remember all the edges, but if we > are sure that we cannot hit those with simple co-/contra-variance, > then I don't think th

Re: [PHP-DEV] Make Closure covariant to callable

2024-11-12 Thread Levi Morrison
There are some weird cases with `callable` which is why they aren't allowed as a property type. I don't remember all the edges, but if we are sure that we cannot hit those with simple co-/contra-variance, then I don't think this needs an RFC and we can just merge the PR.

Re: [PHP-DEV] Make Closure covariant to callable

2024-11-12 Thread Gina P. Banyard
On Tuesday, 12 November 2024 at 16:43, Claude Pache wrote: > But personally, I would be more interested in having a type equivalent to > `callable&object`, that is all objects that implement the `__invoke()` magic > method (this is a strict super-type of \Closure). > > —Claude An Invokable i

Re: [PHP-DEV] Make Closure covariant to callable

2024-11-12 Thread Larry Garfield
On Tue, Nov 12, 2024, at 10:43 AM, Claude Pache wrote: >> Le 12 nov. 2024 à 14:53, Gina P. Banyard a écrit : >> >> Hello internals, >> >> Ondřej Mirtes (author of PHPStan) remarked to me in August that Closure is >> not a subtype of callable. >> The implementation of this is quite straight forw

Re: [PHP-DEV] Make Closure covariant to callable

2024-11-12 Thread Niels Dossche
On 12/11/2024 14:53, Gina P. Banyard wrote: > Hello internals, > > Ondřej Mirtes (author of PHPStan) remarked to me in August that Closure is > not a subtype of callable. > The implementation of this is quite straight forward and can be seen on > GitHub. [1] > The question is if there are any co

Re: [PHP-DEV] Make Closure covariant to callable

2024-11-12 Thread Claude Pache
> Le 12 nov. 2024 à 14:53, Gina P. Banyard a écrit : > > Hello internals, > > Ondřej Mirtes (author of PHPStan) remarked to me in August that Closure is > not a subtype of callable. > The implementation of this is quite straight forward and can be seen on > GitHub. [1] > The question is if t

Re: [PHP-DEV] Make Closure covariant to callable

2024-11-12 Thread Rob Landers
On Tue, Nov 12, 2024, at 14:53, Gina P. Banyard wrote: > Hello internals, > > Ondřej Mirtes (author of PHPStan) remarked to me in August that Closure is > not a subtype of callable. > The implementation of this is quite straight forward and can be seen on > GitHub. [1] > The question is if the

[PHP-DEV] Make Closure covariant to callable

2024-11-12 Thread Gina P. Banyard
Hello internals, Ondřej Mirtes (author of PHPStan) remarked to me in August that Closure is not a subtype of callable. The implementation of this is quite straight forward and can be seen on GitHub. [1] The question is if there are any concern or not and if this requires an RFC or can just be m