Repository navigation
Assert checker errors cannot use the Message diagnostic category - #65318
Open
Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 5 commits into
Open
Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 5 commits into
Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 5 commits into
Conversation
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix TS1450 to report error instead of message
Assert checker errors cannot use the Message diagnostic category
Nov 4, 2026
Ryan Cavanaugh (RyanCavanaugh)
requested changes
Nov 5, 2026
Ryan Cavanaugh (RyanCavanaugh)
left a comment
Member
There was a problem hiding this comment.
Copilot just remove the testcase please
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Contributor
Author
Ryan Cavanaugh (RyanCavanaugh)
approved these changes
Nov 5, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
TS1450 still has CategoryMessage, so the always-active assertion turns an ordinary import() grammar error into a checker panic instead of a diagnostic.
1 open issue
What changed in this PR
Adds a checker invariant to prevent diagnostics from being reported as informational messages rather than errors, addressing the enforcement gap exposed by TS1450.
Changes:
- Adds an assertion in
Checker.addDiagnosticcovering semantic and grammar diagnostics. - Leaves Message-category related information unaffected; the TS1450 category correction is handled separately.
| File | Description |
|---|---|
tsc/internal/checker/checker.go |
Rejects top-level Message-category diagnostics when adding checker diagnostics. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #65309
Analysis
TS1450 exposes a missing invariant: the checker can issue an error with category Message, causing editors to display information instead of an error. The category correction is handled separately.
Fix
Checker.addDiagnostic, covering both semantic and grammar errors.Existing TS1450 cases intentionally panic until the separate category fix lands.
Copilot Checklist
Validation was run but fails on the intended TS1450 assertion:
import()arguments) is reported with category "message" instead of "error" #65309