Bug report
While working on phpstan/phpstan-src#2230, I discovered another issue with in_array type specifier.
Code snippet that reproduces the problem
https://phpstan.org/r/3e01e64c-0c75-4944-adb4-1f16c8c3418f
Expected output
I'm not sure what PHPStan would be able to do.
Narrowing the array array{0: 1, 1?: 2} with an in_array(2, check would be great. But we have to care about doing this like array{0: 1, 1?: 2, 2?: 2}
But at least the last error Expected type 2, actual: *NEVER* seems to be a bug to me.
Bug report
While working on phpstan/phpstan-src#2230, I discovered another issue with in_array type specifier.
Code snippet that reproduces the problem
https://phpstan.org/r/3e01e64c-0c75-4944-adb4-1f16c8c3418f
Expected output
I'm not sure what PHPStan would be able to do.
Narrowing the array
array{0: 1, 1?: 2}with anin_array(2,check would be great. But we have to care about doing this likearray{0: 1, 1?: 2, 2?: 2}But at least the last error
Expected type 2, actual: *NEVER*seems to be a bug to me.