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

Bug: RedundantCondition with message "Type scalar for $value is never false" when $value can be false #8795

Closed
vjik opened this issue Nov 30, 2022 · 1 comment

Comments

@vjik
Copy link
Contributor

vjik commented Nov 30, 2022

https://psalm.dev/r/047ebf7507

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/047ebf7507
<?php

function test(int|float|string|bool $value): void {
    echo $value === false ? 'is real false' : 'other';
}
Psalm output (using commit c3cc906):

ERROR: RedundantCondition - 4:47 - Type scalar for $value is never false

orklah added a commit to orklah/psalm that referenced this issue Nov 30, 2022
@orklah orklah closed this as completed in 229f613 Nov 30, 2022
orklah added a commit that referenced this issue Nov 30, 2022
handle true/false reconciliation consistently, fix #8795
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants