On Thu, Mar 20, 2025 at 4:00 PM Larry Garfield
wrote:
> I have a use case for this in Serde, so would be in favor.
>
> We should not block this kind of improvement on the hope of generics.
> Worst case, we have this plus generics so you have options, how terrible.
>
>
Would you mind sharing detai
On 2025-03-20 18:50, Daniel Scherzer wrote:
The original inspiration which I discussed in the RFC is fixing the
signature of the BackedEnum methods, which currently use the second
option.
Hey,
I'm not opposed to having a bottom type, but the `try`/`tryFrom` issue
feels caused by another
On Thu, Mar 20, 2025, at 11:24 AM, Gina P. Banyard wrote:
> As the person that had the initial discussion in R11 with Jordan [1]
> never as a parameter type for an interface actually is not the solution
> for "poor man generics".
> Matthew Fonda [2] already replied to the thread pointing out the
On Thu, Mar 20, 2025 at 9:51 AM Daniel Scherzer
wrote:
> On Sun, Mar 16, 2025 at 12:31 PM Matt Fonda
> wrote:
>
>> Hi Daniel,
>>
>> I believe this feature essentially amounts to "add methods which can
>> never be called", which in my mind makes no sense. If a method types
>> against an interface
Hi
Am 2025-03-20 21:27, schrieb Matt Fonda:
If an interface adds a method but makes no promises about what
parameters
it accepts, then why is it part of the interface in the first
place--why
add a method that can't be used?
It would more cleanly allow for userland / PHPDoc-based generics, wh
Hi Larry,
On Fri, Mar 28, 2025 at 7:48 PM Larry Garfield
wrote:
> I have to think people are misunderstanding Nikita's earlier comment, or
> perhaps that he phrased it poorly.
>
> The determination of whether a method call is type-compatible with the
> parameters passed to it is made *at runtime
On Fri, Mar 28, 2025, at 3:42 PM, Matt Fonda wrote:
> Hi Tim and Larry,
>
> Thanks for sharing examples. I'm not sure I follow how never parameters
> help in either of these cases. As far as I can tell, the problem
> remains that these methods can't actually be called.
> I share Nikita's sentime
Hi Tim and Larry,
Thanks for sharing examples. I'm not sure I follow how never parameters
help in either of these cases. As far as I can tell, the problem remains
that these methods can't actually be called.
On Fri, Mar 21, 2025 at 4:50 AM Tim Düsterhus wrote:
> Am 2025-03-20 21:27, schrieb Mat
Hi
Am 2025-03-21 21:41, schrieb Gina P. Banyard:
Am I following that? Because just from writing that I am not sure I
agree, which means I may be misunderstanding. :-)
I am saying:
interface I {
pubic function foo(never $a);
}
can ***not*** be "upgraded" to
interface I {
pubic function
Hi
Am 2025-03-25 21:42, schrieb Rowan Tommins [IMSoP]:
And I've seen plenty of junior devs struggle with simple things like
the difference between "nullable" and "optional", so I worry that
making the type system too rich will lose PHP its reputation as an
approachable language.
It's possib
On 25 March 2025 18:14:21 GMT, Daniel Scherzer
wrote:
>On Tue, Mar 25, 2025 at 11:01 AM Rowan Tommins [IMSoP]
>wrote:
>
>>
>> I don't think the language should pretend to support something that it
>> doesn't
>>
>
>I don't see what the pretending is here - the engine supports declaring
>that a
On Tue, Mar 25, 2025 at 11:01 AM Rowan Tommins [IMSoP]
wrote:
>
> I don't think the language should pretend to support something that it
> doesn't
>
I don't see what the pretending is here - the engine supports declaring
that a method must accept a parameter but makes no promises about the type
On Thursday, 20 March 2025 at 16:57, Larry Garfield
wrote:
> On Thu, Mar 20, 2025, at 11:24 AM, Gina P. Banyard wrote:
>
> > As the person that had the initial discussion in R11 with Jordan [1]
> > never as a parameter type for an interface actually is not the solution
> > for "poor man generic
On 21/03/2025 11:50, Tim Düsterhus wrote:
Am 2025-03-20 21:27, schrieb Matt Fonda:
If an interface adds a method but makes no promises about what
parameters
it accepts, then why is it part of the interface in the first place--why
add a method that can't be used?
It would more cleanly allow fo
On Thu, Mar 20, 2025, at 6:02 PM, Daniel Scherzer wrote:
> On Thu, Mar 20, 2025 at 4:00 PM Larry Garfield wrote:
>> I have a use case for this in Serde, so would be in favor.
>>
>> We should not block this kind of improvement on the hope of generics. Worst
>> case, we have this plus generics so
Hi
Am 2025-03-20 21:04, schrieb Juris Evertovskis:
I'm not opposed to having a bottom type, but the `try`/`tryFrom` issue
feels caused by another shortcoming.
In my view`from` and `tryFrom` are factory methods that construct an
instance by being called on the class itself. As such they should
On Sun, Mar 16, 2025 at 12:31 PM Matt Fonda wrote:
> Hi Daniel,
>
> I believe this feature essentially amounts to "add methods which can never
> be called", which in my mind makes no sense. If a method types against an
> interface, and that interface uses a method with a never parameter type,
> t
On Tuesday, 11 March 2025 at 21:45, Larry Garfield
wrote:
> On Mon, Mar 10, 2025, at 2:05 PM, Daniel Scherzer wrote:
>
> > Hi internals,
> >
> > I'd like to start discussion on a new RFC about allowing `never` for
> > parameter types when declaring a method.
> >
> > * RFC: https://wiki.php.ne
On Mon, Mar 10, 2025 at 12:07 PM Daniel Scherzer <
daniel.e.scher...@gmail.com> wrote:
> Hi internals,
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
> * RFC: https://wiki.php.net/rfc/never-parameters-v2
> * Implementation: htt
On Thu, Mar 13, 2025, at 10:35 AM, Tim Düsterhus wrote:
> Hi
>
> Am 2025-03-11 22:45, schrieb Larry Garfield:
>> We should not block this kind of improvement on the hope of generics.
>> Worst case, we have this plus generics so you have options, how
>> terrible.
>
> In this case, I agree. This i
Hi
Am 2025-03-11 22:45, schrieb Larry Garfield:
We should not block this kind of improvement on the hope of generics.
Worst case, we have this plus generics so you have options, how
terrible.
In this case, I agree. This is an obvious addition to the type system
that uses the existing infras
On 10 Mar 2025, at 20:07, Daniel Scherzer wrote:
> Hi internals,
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
> * RFC: https://wiki.php.net/rfc/never-parameters-v2
> * Implementation: https://github.com/php/php-src/pull/18
>
>> I would also personally prefer associated types: ... This at least lets you
>> ensure the "other point" is the same type in both functions, though
>> personally, I'd rather just have generics.
>
> I'd also like to have generics, but that isn't something I can implement
> myself. Associa
On Mon, Mar 10, 2025, at 2:05 PM, Daniel Scherzer wrote:
> Hi internals,
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
> * RFC: https://wiki.php.net/rfc/never-parameters-v2
> * Implementation: https://github.com/php/php-src/pu
[responding to multiple people instead of spamming multiple emails, I hope
that is okay]
On Mon, Mar 10, 2025 at 12:38 PM Eugene Sidelnyk
wrote:
>
> Yet, do you think it's reasonable that "never" type should be used rather
> than "void"? From what I know, never - is a special type used whe
> Hi internals,
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
At first signature seemed somewhat confusing to me, but now it makes
perfect sense.
Type-wise, about LSP, I find it logical that more concrete implementations
cou
Hi Daniel
On Mon, Mar 10, 2025 at 8:06 PM Daniel Scherzer
wrote:
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
> * RFC: https://wiki.php.net/rfc/never-parameters-v2
> * Implementation: https://github.com/php/php-src/pull/180
Hi internals,
I'd like to start discussion on a new RFC about allowing `never` for
parameter types when declaring a method.
* RFC: https://wiki.php.net/rfc/never-parameters-v2
* Implementation: https://github.com/php/php-src/pull/18016
-Daniel
On Mon, Mar 10, 2025, at 20:05, Daniel Scherzer wrote:
> Hi internals,
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
> * RFC: https://wiki.php.net/rfc/never-parameters-v2
> * Implementation: https://github.com/php/php-src/pu
Hi Daniel,
> On Mar 11, 2025, at 08:05, Daniel Scherzer
> wrote:
>
> Hi internals,
>
> I'd like to start discussion on a new RFC about allowing `never` for
> parameter types when declaring a method.
>
> * RFC: https://wiki.php.net/rfc/never-parameters-v2
> * Implementation: https://github.co
30 matches
Mail list logo