G
YouTube TikTok Games
Skip to content

Don't let TypeQuery have PropertyAccessExpression as ExprName - #65501

Closed
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/type-query-entity-names
Closed

Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/type-query-entity-names

Conversation

@jakebailey

Copy link
Copy Markdown
Member

This is another AST node type violation. Instead of sticking a property access in here, just write the code that actually converts it into an entity name.

Qualified annotation names and instantiated symbol chains could place
property access expressions in TypeQuery.ExprName. Identical printed
spellings concealed those malformed children.

Convert annotation expression chains and normalize checker query names,
keeping type arguments after the complete name. Require entity names in
the printer once both producers supply them.

Keep the qualified object-spread codefix text unchanged.
Copilot AI balanced review requested due to automatic review settings November 14, 2026 06:36
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 14, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 14, 2026

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.

🟢 Approval recommended

No active review issues were identified for the type-query entity-name changes.

No open issues 🎉

What changed in this PR

This PR enforces valid entity names in TypeQuery nodes in the native TypeScript compiler and language server, replacing property-access expressions with qualified names.

Changes:

  • Adds an expression-to-entity-name helper and uses it when constructing type queries.
  • Removes the printer workaround and keeps type-query arguments after the complete entity name.
  • Adds a fourslash regression test for annotating a qualified object spread.
File Description
tsc/​internal/​printer/​printer.go Removes property-access handling from entity-name printing.
tsc/​internal/​printer/​factory.go Adds recursive conversion from expressions to entity names.
tsc/​internal/​ls/​codeactions_fixmissingtypeannotation.go Uses the helper for typeof annotations.
tsc/​internal/​fourslash/​tests/​codeFixMissingTypeAnnotationOnExports34-object-spread_test.go Tests annotation of a nested namespace object spread.
tsc/​internal/​checker/​nodebuilderimpl.go Constructs valid type-query entity names and adjusts type-argument placement.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Done in PR Backlog Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants