Skip to content

add static property duplicate name check #3804

Merged
iisaduan merged 5 commits into
microsoft:mainfrom
iisaduan:staticPropertyNameConflicts
May 12, 2026
Merged

add static property duplicate name check #3804
iisaduan merged 5 commits into
microsoft:mainfrom
iisaduan:staticPropertyNameConflicts

Conversation

@iisaduan
Copy link
Copy Markdown
Member

fixes #3484

Copilot AI review requested due to automatic review settings May 11, 2026 23:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes #3484 by restoring TS2699 diagnostics for static class members that conflict with built-in Function properties when useDefineForClassFields is false, aligning tsgo’s output with expected baselines and removing an obsolete triaged diff.

Changes:

  • Add a checker pass during class-like declaration checking to report TS2699 for conflicting static member names (e.g. name, length, caller, arguments, prototype) under the relevant compiler option conditions.
  • Update the conformance error baseline for staticPropertyNameConflicts(...,usedefineforclassfields=false) to include the restored TS2699 errors.
  • Remove the now-unneeded triaged .diff baseline for the same conformance case.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
internal/checker/checker.go Adds a class-like static member conflict check intended to restore TS2699 for built-in Function property name collisions.
testdata/baselines/reference/submodule/conformance/staticPropertyNameConflicts(target=es2015,usedefineforclassfields=false).errors.txt Updates expected errors to reflect restored TS2699 diagnostics (now matching upstream expectations for this configuration).
testdata/baselines/reference/submoduleTriaged/conformance/staticPropertyNameConflicts(target=es2015,usedefineforclassfields=false).errors.txt.diff Removes an obsolete triaged diff baseline because the behavior is no longer divergent.

Comment thread internal/checker/checker.go
Comment thread internal/checker/checker.go Outdated
Comment thread internal/checker/checker.go Outdated
@iisaduan iisaduan added this pull request to the merge queue May 12, 2026
Merged via the queue into microsoft:main with commit 35e8f91 May 12, 2026
21 checks passed
@iisaduan iisaduan deleted the staticPropertyNameConflicts branch May 12, 2026 20:57
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.

Static property conflicts with built-in Function properties (TS2699) no longer reported when useDefineForClassFields is false

3 participants