Skip to content

fix: report optional-chain tagged templates after non-null assertions - #64226

Open
Cameron (camc314) wants to merge 1 commit into
microsoft:mainfrom
camc314:c/missing-1358
Open

fix: report optional-chain tagged templates after non-null assertions#64226
Cameron (camc314) wants to merge 1 commit into
microsoft:mainfrom
camc314:c/missing-1358

Conversation

@camc314

@camc314 Cameron (camc314) commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Non-null assertions currently allow tagged templates to bypass TS1358 errors:

var f: any;
f?.x!`text`; // Previously accepted; now reports TS1358 (Tagged template expressions are not permitted in an optional chain.).

Update the tagged-template grammar check to look through non-null assertions when checking for an optional chain.

Copilot AI balanced review requested due to automatic review settings September 10, 2026 09:59
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 10, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 10, 2026
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants