Skip to content

Obtain late-bound symbol in error reporting#4233

Merged
ahejlsberg merged 5 commits into
mainfrom
fix-4224
Jun 7, 2026
Merged

Obtain late-bound symbol in error reporting#4233
ahejlsberg merged 5 commits into
mainfrom
fix-4224

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

Fixes #4224.

Copilot AI review requested due to automatic review settings June 6, 2026 22:03

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

This PR fixes diagnostic reporting for late-bound (computed-name) class members so incompatibilities are reported as member-level errors (e.g. TS2416) rather than as a class-level “incorrectly extends/implements” error (e.g. TS2415/TS2420), aligning tsgo output with upstream TypeScript behavior.

Changes:

  • Update issueMemberSpecificError to use the late-bound symbol for computed-name members when selecting a property to report against.
  • Add a new compiler regression test (sameComputedNameError.ts) with corresponding .errors/.types/.symbols baselines.
  • Update submodule conformance baselines and remove an now-unneeded accepted diff entry for symbolProperty24.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/checker/checker.go Adjust member-specific error reporting to use late-bound symbols for computed members.
testdata/tests/cases/compiler/sameComputedNameError.ts New regression test for computed-name override error reporting.
testdata/baselines/reference/compiler/sameComputedNameError.errors.txt Baseline asserting TS2416 on the computed-name member in the derived class.
testdata/baselines/reference/compiler/sameComputedNameError.types Type baseline for the new regression test.
testdata/baselines/reference/compiler/sameComputedNameError.symbols Symbol baseline for the new regression test.
testdata/baselines/reference/submodule/conformance/symbolProperty24.errors.txt Updated upstream conformance baseline now expecting member-level TS2416 reporting.
testdata/submoduleAccepted.txt Remove symbolProperty24 from accepted diffs now that the port matches upstream.
testdata/baselines/reference/submoduleAccepted/conformance/symbolProperty24.errors.txt.diff Delete obsolete accepted diff file (no longer needed after baseline alignment).

Comment thread internal/checker/checker.go Outdated
Comment on lines 4478 to 4479
declaredProp := c.getLateBoundSymbol(member.Symbol())
if declaredProp != nil && declaredProp.Name != ast.InternalSymbolNameComputed {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, we should preserve the nil check

@ahejlsberg ahejlsberg added this pull request to the merge queue Jun 6, 2026
@ahejlsberg ahejlsberg removed this pull request from the merge queue due to a manual request Jun 6, 2026
@ahejlsberg ahejlsberg requested a review from jakebailey June 6, 2026 22:56
@ahejlsberg ahejlsberg added this pull request to the merge queue Jun 7, 2026
Merged via the queue into main with commit cbd610a Jun 7, 2026
21 checks passed
@ahejlsberg ahejlsberg deleted the fix-4224 branch June 7, 2026 01:36
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.

Late-bound (computed-name) member incompatibility reported as class-level TS2415

3 participants