Skip to content

Remove an random accessor from object literal grammar checking - #65469

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/object-grammar
Nov 13, 2026
Merged

Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/object-grammar

Conversation

@jakebailey

Copy link
Copy Markdown
Member

No idea what this is doing here.

Shorthand properties have no class-like data, and the discarded accessor
result does not participate in grammar checking. Remove the stray call
while retaining the named-member checks.

Exercise valid shorthand properties and their optional, assertion,
initializer, and duplicate-name grammar diagnostics.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 04:44
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 13, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 13, 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 change removing the unused accessor call.

No open issues 🎉

What changed in this PR

Removes a side-effect-free ClassLikeData() call from the native TypeScript compiler’s object-literal grammar checker, preserving existing validation behavior.

Changes:

  • Removes the unused accessor call when checking shorthand properties.
  • Adds coverage for valid shorthand properties, optional and definite-assignment markers, initializers, and duplicate names.
  • Records expected diagnostics, JavaScript output, types, and symbols.
File Description
tsc/​testdata/​tests/​cases/​compiler/​objectShorthandGrammar.ts Adds valid and invalid object-property test cases.
tsc/​testdata/​baselines/​reference/​compiler/​objectShorthandGrammar.types Records inferred types, including error recovery.
tsc/​testdata/​baselines/​reference/​compiler/​objectShorthandGrammar.symbols Records property symbols and declaration associations.
tsc/​testdata/​baselines/​reference/​compiler/​objectShorthandGrammar.js Records JavaScript emit for the test cases.
tsc/​testdata/​baselines/​reference/​compiler/​objectShorthandGrammar.errors.txt Records the four expected grammar diagnostics.
tsc/​internal/​checker/​grammarchecks.go Removes the unused ClassLikeData() call.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 13, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 13, 2026
Merged via the queue into microsoft:main with commit 9a65819 Nov 13, 2026
34 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the compiler-fixes/object-grammar branch November 13, 2026 18:44
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 13, 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.

3 participants