Open AndrolGenhald opened 3 years ago
I found these snippets:
This should be an
InvalidArgument
More precisely, it should be PossiblyInvalidArgument
.
I'm not sure I fully understand the difference between InvalidArgument
and PossiblyInvalidArgument
. Should psalm always emit PossiblyInvalidArgument
when it's possible the argument has the correct type?
Should psalm always emit PossiblyInvalidArgument when it's possible the argument has the correct type?
Yes, if an argument type has an intersection with the required parameter type then it's a possibly invalid call: https://psalm.dev/r/686b176d87
InvalidScalarArgument
, however, currently doesn't have it's Possibly*
counterpart, so this can be a bit confusing.
I found these snippets:
This should be an InvalidArgument: https://psalm.dev/r/410b622a1f It's currently allowed because the type can be an iterable, but it should be disallowed if the type can be anything other than iterable.