Obtain late-bound symbol in error reporting#4233
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
issueMemberSpecificErrorto 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/.symbolsbaselines. - 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 on lines
4478
to
4479
| declaredProp := c.getLateBoundSymbol(member.Symbol()) | ||
| if declaredProp != nil && declaredProp.Name != ast.InternalSymbolNameComputed { |
Member
Author
There was a problem hiding this comment.
Yeah, we should preserve the nil check
jakebailey
approved these changes
Jun 6, 2026
jakebailey
approved these changes
Jun 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4224.