in_array
assertion with dynamic haystack doesn't reconcile needle type to array's value type
#6220
Labels
in_array
assertion with dynamic haystack doesn't reconcile needle type to array's value type
#6220
Example:
Errors:
I expect
$val
to beint
type after the assertion.In all the cases I tested with haystack being
non-empty-list<T>
psalm fails to reconcile the needle type toT
after the assertion. It works fine with fixed arrays though (e. g.[0, 1]
)More examples:
https://psalm.dev/r/53fed31716
The text was updated successfully, but these errors were encountered: