-
-
Notifications
You must be signed in to change notification settings - Fork 930
Closed
Description
Bug report
When I pass an argument of type T
, where T
is T of EnumType::*
to a function, the type of the changed parameter is changed to T<EnumType>
instead of T<actual enum type>
.
For example, if I pass Foo<Bar::Baz>
as a function parameter to a function /** @param S $foo */ function foobar($foobar);
, type of S
is detected as Foo<Bar>
, not Foo<Bar::Baz>
. So, the parameter fails to match its own generic type. Instead an message about template covariance is reported.
Code snippet that reproduces the problem
https://phpstan.org/r/6056f0bd-2f52-456f-8bb1-bd746091fafb
Expected output
The generic type S
is the type of the passed argument. So it should should always pass validation.