Skip to content

Move ID error to favor class expression inference failure when present#4523

Merged
weswigham merged 1 commit into
microsoft:mainfrom
weswigham:move-class-expression-error
Jul 2, 2026
Merged

Move ID error to favor class expression inference failure when present#4523
weswigham merged 1 commit into
microsoft:mainfrom
weswigham:move-class-expression-error

Conversation

@weswigham

Copy link
Copy Markdown
Member

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.

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.

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 isolatedDeclarationErrorsClassesExpressions to match the corrected diagnostic.
  • Remove the now-unneeded submoduleTriaged entry and its corresponding .diff file.

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.

Comment thread internal/pseudochecker/lookup.go
@weswigham weswigham enabled auto-merge July 2, 2026 17:23
@weswigham weswigham added this pull request to the merge queue Jul 2, 2026
Merged via the queue into microsoft:main with commit 2483843 Jul 2, 2026
21 checks passed
@weswigham weswigham deleted the move-class-expression-error branch July 2, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants