-
-
Notifications
You must be signed in to change notification settings - Fork 947
Incorrect generic type resolution #10612
Copy link
Copy link
Closed
phpstan/phpstan-src
#4787Description
Bug report
In attached example, the first error in the associate function started happening only in quite recent versions of phpstan and worked fine until then.
The issue here is that even phpstan sees the $key variable as int, for some reason it's interpreted as int|string when passed as array key in the associate function
Code snippet that reproduces the problem
Expected output
The type of array key should be int as well
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable