We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I simplified my code to https://psalm.dev/r/1c3274bd0a In my real case, I'm adding another array.
I don't understand why the value is considered as possibly mixed.
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php final class Token { public const ONE = [ 16 => 16, 21 => 21, ]; public const TWO = [ 17 => 17, 22 => 22, ]; public const THREE = [ 18 => 18, 23 => 23, ]; public const RESULT = self::ONE + self::TWO + self::THREE; /** * @param int|int[] $bar * @return int|int[] */ public function foo($bar) { return $bar; } public function test(): void { $this->foo(self::RESULT); } }
Psalm output (using commit 3fb9e1c): INFO: MixedArgumentTypeCoercion - 31:20 - Argument 1 of Token::foo expects array<array-key, int>|int, parent type array{16: 16, 17: 17, 18: 18|mixed, 21: 21, 22: 22, 23: 23|mixed} provided
Sorry, something went wrong.
Funny thing that it works for (any) two arrays, but not for three.
Successfully merging a pull request may close this issue.
I simplified my code to https://psalm.dev/r/1c3274bd0a
In my real case, I'm adding another array.
I don't understand why the value is considered as possibly mixed.
The text was updated successfully, but these errors were encountered: