Skip to content

Fix function/constructor/enum checks that relied on walking the "first declaration"#2788

Merged
jakebailey merged 3 commits into
mainfrom
jabaile/duplicate-func-checking
Feb 17, 2026
Merged

Fix function/constructor/enum checks that relied on walking the "first declaration"#2788
jakebailey merged 3 commits into
mainfrom
jabaile/duplicate-func-checking

Conversation

@jakebailey

Copy link
Copy Markdown
Member

controlFlowFunctionLikeCircular1 was failing in concurrent checking for the same reasons we needed #2134.

This PR applies the same fix to the other places where we checked the "first declaration" of something in order to ensure it was only checked once.

Not 100% sure which links struct to use, so I let copilot choose. 😅

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 updates the Go checker to avoid “check only on first declaration” patterns that break under concurrent checking, ensuring function/constructor/enum validation runs exactly once per symbol per checker (similar to the approach taken in #2134). It also re-enables the previously skipped concurrent-checking test case by accepting new baselines.

Changes:

  • Replace “first declaration” gating for function/constructor checks with a per-checker ValueSymbolLinks guard (functionOrConstructorChecked).
  • Replace “first declaration” gating for enum checks with a per-checker DeclaredTypeLinks guard (enumChecked).
  • Unskip controlFlowFunctionLikeCircular1.ts and add/update baselines accordingly.

Reviewed changes

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

Show a summary per file
File Description
internal/checker/checker.go Removes first-declaration gating and introduces per-checker “checked once” guards for function/constructor symbols and enums.
internal/checker/types.go Extends symbol link structs with new boolean guards used by the checker.
internal/testrunner/compiler_runner.go Removes controlFlowFunctionLikeCircular1.ts from the concurrent-checking skip list.
testdata/baselines/reference/submodule/conformance/templateInsideCallback.errors.txt Updates expected tsgo diagnostics output for the conformance/jsdoc test.
testdata/baselines/reference/submodule/conformance/templateInsideCallback.errors.txt.diff Updates the tracked diff vs the TS submodule baseline (shows remaining divergence).
testdata/baselines/reference/submodule/compiler/controlFlowFunctionLikeCircular1.* Adds/updates baselines now that the test is no longer skipped.

Comment on lines 11 to 13
templateInsideCallback.js(23,5): error TS8039: A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag
+templateInsideCallback.js(29,5): error TS2394: This overload signature is not compatible with its implementation signature.
+templateInsideCallback.js(29,5): error TS7012: This overload implicitly returns the type 'any' because it lacks a return type annotation.

Copilot AI Feb 14, 2026

Copy link

Choose a reason for hiding this comment

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

The new TS2394 entry is marked with a leading '+' in this .diff baseline, which indicates tsgo is now emitting an extra diagnostic that the TypeScript submodule baseline does not. Please double-check upstream behavior for this test; if TS doesn’t report TS2394 here, this likely represents a regression (and the fix should avoid emitting it). If the mismatch is intentional/acceptable, consider moving this diff to the submoduleAccepted baselines so we’re explicitly tracking it as an accepted divergence.

Copilot uses AI. Check for mistakes.
@jakebailey jakebailey added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 4f2f241 Feb 17, 2026
26 checks passed
@jakebailey jakebailey deleted the jabaile/duplicate-func-checking branch February 17, 2026 23:44
Copilot AI pushed a commit that referenced this pull request Feb 25, 2026
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.

3 participants