You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the issue raised by Psalm is not correct. While iterator_to_array does throw a TypeError in case of a non-scalar key (https://3v4l.org/BBOJF), the returned type of iterator_to_array(T, true) is never array<mixed, T>, it is array<array-key, T>.
The text was updated successfully, but these errors were encountered:
Psalm output (using commit dd4d970):
INFO: MixedReturnTypeCoercion - 11:12 - The type 'array<TKey:fn-toarray as mixed, TValue:fn-toarray as mixed>' is more general than the declared return type 'array<array-key, TValue:fn-toarray as mixed>' for toArray
INFO: MixedReturnTypeCoercion - 7:12 - The declared return type 'array<array-key, TValue:fn-toarray as mixed>' for toArray is more specific than the inferred return type 'array<TKey:fn-toarray as mixed, TValue:fn-toarray as mixed>'
https://psalm.dev/r/ce986a03b8
I think the issue raised by Psalm is not correct. While
iterator_to_array
does throw aTypeError
in case of a non-scalar key (https://3v4l.org/BBOJF), the returned type ofiterator_to_array(T, true)
is neverarray<mixed, T>
, it isarray<array-key, T>
.The text was updated successfully, but these errors were encountered: