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

Consistency for empty reconciliations #7663

Merged
merged 1 commit into from Feb 13, 2022
Merged

Consistency for empty reconciliations #7663

merged 1 commit into from Feb 13, 2022

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Feb 13, 2022

When Psalm tries to reconcile an assertion with a type, there are cases where the result is empty. (meaning every possible known value has been excluded by the assertion).

There was inconsistencies between returning never, returning mixed and a conditional that checks the from_docblock to return mixed or never.

I didn't see the goal of checking the from_docblock, but when I removed it, I realized the goal is to allow checking an expected type from a docblock (There is a Validator test for that). I changed every case into the conditional for consistency

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Feb 13, 2022
@orklah orklah merged commit 8a49cac into vimeo:master Feb 13, 2022
kkmuffme added a commit to kkmuffme/psalm that referenced this pull request Nov 18, 2023
revert vimeo#7663 including previous from_docblock Mixed assignments, as the tests required 2 suppressions and created an escape hatch via mixed on higher psalm error levels, where mixed isn't reported, thus hiding potentially fatal bugs.
It's still possible to run the validation of docblock docs though: now with 1 @psalm-suppress (instead of 2) and a @var declaration that contains both possible types, to ensure later code won't escape any checks

This is also a required preparation to fix some isset issues of vimeo#9759
kkmuffme added a commit to kkmuffme/psalm that referenced this pull request Nov 18, 2023
revert vimeo#7663 including previous from_docblock Mixed assignments, as the tests required 2 suppressions and created an escape hatch via mixed on higher psalm error levels, where mixed isn't reported, thus hiding potentially fatal bugs.
It's still possible to run the validation of docblock docs though: a @var declaration that contains both possible types, to ensure later code won't escape any checks (and no @psalm-suppress needed at all)

This is also a required preparation to fix some isset issues of vimeo#9759
kkmuffme added a commit to kkmuffme/psalm that referenced this pull request Nov 18, 2023
revert vimeo#7663 including previous from_docblock Mixed assignments, as the tests required 2 suppressions and created an escape hatch via mixed on higher psalm error levels, where mixed isn't reported, thus hiding potentially fatal bugs.
It's still possible to run the validation of docblock docs though: a @var declaration that contains both possible types, to ensure later code won't escape any checks (and no @psalm-suppress needed at all)

This is also a required preparation to fix some isset issues of vimeo#9759
kkmuffme added a commit to kkmuffme/psalm that referenced this pull request Nov 21, 2023
revert vimeo#7663 including previous from_docblock Mixed assignments, as the tests required 2 suppressions and created an escape hatch via mixed on higher psalm error levels, where mixed isn't reported, thus hiding potentially fatal bugs.
It's still possible to run the validation of docblock docs though: a @var declaration that contains both possible types, to ensure later code won't escape any checks (and no @psalm-suppress needed at all)

This is also a required preparation to fix some isset issues of vimeo#9759
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant