Bug report
Array key which is a value of type int returned from static method called on string prechecked by is_a is wrongly treated as int|string in PHPStan 1.4.1 (there was no error in PHPStan 1.3.1):
class Foo {
public static function getCode(): int {
return 1;
}
}
if (is_a($fooClass, Foo::class, true)) {
$this->someMap[$fooClass::getCode()] = true;
}
Property Bar::$someMap (array<int, bool>) does not accept array<int|string, bool>.
The issue might be related to #6403, but it looks like a little bit different.
Code snippet that reproduces the problem
https://phpstan.org/r/f2efd61c-09c3-4f12-8694-a353dbb4c245
Expected output
No error should be reported.