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 remark
> Nikita made in the discussion of the previous RFC.
> But importantly, going from mixed parameter type to a generic parameter
> type is *allowed* and not a BC change,
> however, going from a never parameter type to a generic parameter type
> is a BC break.
To clarify, you're saying this:
interface I {
pubic function foo(mixed $a);
}
class C implements I {
public function foo(mixed $b) { ... }
}
Can turn into this:
interface I<A> {
pubic function foo(A $a);
}
class C implements I<Foo> {
public function foo(Foo $b) { ... }
}
But this could not turn into that:
interface I {
pubic function foo(never $a);
}
class C implements I {
public function foo(Foo $b) { ... }
}
Am I following that? Because just from writing that I am not sure I agree, which means I may be
misunderstanding. :-)
--Larry Garfield