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

Remove incorrect call to checkTruthinessExpression #59507

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

RyanCavanaugh
Copy link
Member

Fixes #59505

The removed baseline here demonstrates another manifestation of the problem; the expression

a ?? 'foo' ? 1 : 2

parses as

(a ?? 'foo') ? 1 : 2

so (a ?? 'foo') is a valid truthiness check, since a might be a non-nullish falsy value (IOW this expression can produce 2 even though the error incorrectly claimed it couldn't)

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 1, 2024
@RyanCavanaugh RyanCavanaugh merged commit 6f64642 into microsoft:main Aug 2, 2024
32 checks passed
@RyanCavanaugh RyanCavanaugh deleted the fix59505 branch August 2, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

False positive for error: TS2873: This kind of expression is always falsy.
3 participants