Skip to content
New issue

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

Internal: enabling taint/unused analysis will modify unrelated behavior when comparing types #10478

Open
kkmuffme opened this issue Dec 12, 2023 · 1 comment

Comments

@kkmuffme
Copy link
Contributor

Union "equals" has 4 params:

public function equals(

The "parent node" is generally only set when taint/unused is enabled, which means that e.g. comparing arrays will return different results when taint/unused is on vs when it's not, bc the Atomic type only has 2 params:
https://github.com/vimeo/psalm/blob/5.x/src/Psalm/Type/Atomic.php#L776

and e.g. https://github.com/vimeo/psalm/blob/5.x/src/Psalm/Type/Atomic/TArray.php#L87 uses the Union equals, which then causes the "equals" to return different results.

This is extremely unintuitive and causes errors to be reported/missing that are unrelated to either setting.

Copy link

Hey @kkmuffme, can you reproduce the issue on https://psalm.dev ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant