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
Here I would expect array{id: int, something?: int} but array{id: int, something: int} is inferred: https://psalm.dev/r/86bee2c4c8
array{id: int, something?: int}
array{id: int, something: int}
However, when types are declared directly on the using class union type is inferred as expected: https://psalm.dev/r/7062f9c623
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php namespace A\B; /** * @psalm-type _A=array{ * id:int * } * * @psalm-type _B=array{ * id:int, * something:int * } */ class Types { } namespace A; /** * @psalm-import-type _A from \A\B\Types * @psalm-import-type _B from \A\B\Types */ class Id { /** * @psalm-param _A|_B $_item */ public function ff(array $_item): void { /** @psalm-trace $_item */ } }
Psalm output (using commit 9dfdcbe): INFO: Trace - 32:0 - $_item: array{id: int, something: int}
<?php /** * @psalm-type _A=array{ * id:int * } * * @psalm-type _B=array{ * id:int, * something:int * } */ class Id { /** * @psalm-param _A|_B $_item */ public function ff(array $_item): void { /** @psalm-trace $_item */ } }
Psalm output (using commit 9dfdcbe): INFO: Trace - 20:0 - $_item: array{id: int, something?: int}
Sorry, something went wrong.
38af5db
No branches or pull requests
Here I would expect
array{id: int, something?: int}
butarray{id: int, something: int}
is inferred:https://psalm.dev/r/86bee2c4c8
However, when types are declared directly on the using class union type is inferred as expected:
https://psalm.dev/r/7062f9c623
The text was updated successfully, but these errors were encountered: