Skip to content

Unconditionally call checkExpression from checkSatisfiesExpression#51704

Merged
RyanCavanaugh merged 2 commits intomicrosoft:mainfrom
RyanCavanaugh:fix51642
Dec 1, 2022
Merged

Unconditionally call checkExpression from checkSatisfiesExpression#51704
RyanCavanaugh merged 2 commits intomicrosoft:mainfrom
RyanCavanaugh:fix51642

Conversation

@RyanCavanaugh
Copy link
Copy Markdown
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.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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