Skip to content

Unconditionally call checkExpression from checkSatisfiesExpression #51704

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

Merged
merged 2 commits into from
Dec 1, 2022

Conversation

RyanCavanaugh
Copy link
Member

An unenforced invariant of our checker is that all subcalls of checkExpression must unconditionally call checkExpression on their children in order for emit to work. checkSatisfiesExpression broke this by bailing early when the asserted type was invalid, thus breaking the example shown in the OP and testcase

Playground link showing the problem

Fixes #51642. Propose to port to 4.9.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 30, 2022
@RyanCavanaugh RyanCavanaugh changed the title Fix51642 Unconditionally call checkExpression from checkSatisfiesExpression Nov 30, 2022
@RyanCavanaugh
Copy link
Member Author

@typescript-bot cherry-pick this to release-4.9

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 30, 2022

Heya @RyanCavanaugh, I've started to run the task to cherry-pick this into release-4.9 on this PR at dbcd899. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

Hey @RyanCavanaugh, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-4.9 manually.

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
None yet
Development

Successfully merging this pull request may close these issues.

Use of the satisfies keyword removes require statements when TS compiler invoked programmatically
3 participants