Move ID error to favor class expression inference failure when present#4523
Merged
Merged
Conversation
jakebailey
approved these changes
Jul 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts isolated-declarations diagnostics to prefer the dedicated “class expression inference failure” error when a variable initializer is a class expression, aligning outputs with upstream TypeScript and removing a previously-triaged baseline diff.
Changes:
- Report inference-fallback errors for class expression initializers via
NewPseudoTypeInferredWithErrors, causing TS9022 to surface instead of the generic variable-annotation error. - Update the submodule reference baseline for
isolatedDeclarationErrorsClassesExpressionsto match the corrected diagnostic. - Remove the now-unneeded
submoduleTriagedentry and its corresponding.difffile.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
internal/pseudochecker/lookup.go |
Marks ClassExpression inference as an inferred-with-errors pseudo type so ID reports TS9022 at the class expression site. |
testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClassesExpressions.errors.txt |
Updates expected diagnostics to TS9022 + adjusted span to match the new behavior. |
testdata/submoduleTriaged.txt |
Drops the triage entry for the removed baseline diff. |
testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsClassesExpressions.errors.txt.diff |
Removes the triaged diff file since the port now matches the reference baseline. |
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.
Removes a baseline diff without a backing issue from
submoduleTriaged. Nonfunctional, but the special error for class expression inference failure is otherwise unused, so may as well use it.