Skip to content

fix(semantic): regression in tracking scopes#9521

Merged
ematipico merged 1 commit intomainfrom
fix/semantic-regression
Mar 17, 2026
Merged

fix(semantic): regression in tracking scopes#9521
ematipico merged 1 commit intomainfrom
fix/semantic-regression

Conversation

@ematipico
Copy link
Copy Markdown
Member

Summary

Closes #9483
Closes #9492

Test Plan

Added tests

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 17, 2026

🦋 Changeset detected

Latest commit: 4d557c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ematipico ematipico requested review from a team March 17, 2026 10:29
@github-actions github-actions Bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 53139 53139 0
Passed 51919 51919 0
Failed 1178 1178 0
Panics 42 42 0
Coverage 97.70% 97.70% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

markdown/commonmark

Test result main count This PR count Difference
Total 652 652 0
Passed 652 652 0
Failed 0 0 0
Panics 0 0 0
Coverage 100.00% 100.00% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5466 5466 0
Passed 1915 1915 0
Failed 3551 3551 0
Panics 0 0 0
Coverage 35.03% 35.03% 0.00%

ts/babel

Test result main count This PR count Difference
Total 636 636 0
Passed 568 568 0
Failed 68 68 0
Panics 0 0 0
Coverage 89.31% 89.31% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18875 18875 0
Passed 13014 13014 0
Failed 5860 5860 0
Panics 1 1 0
Coverage 68.95% 68.95% 0.00%

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 17, 2026

Walkthrough

This PR fixes issue #9483 by extending the semantic model builder to recognise TypeScript constructor and getter signature node kinds (TS\_CONSTRUCTOR\_SIGNATURE\_CLASS\_MEMBER, TS\_GETTER\_SIGNATURE\_CLASS\_MEMBER, TS\_GETTER\_SIGNATURE\_TYPE\_MEMBER) as scope-bound declarations. A regression test is added demonstrating that the noRedeclare rule no longer panics when encountering constructor overloads.

Possibly related PRs

  • #8459: Both PRs modify the semantic model to include previously-untracked TypeScript signature nodes in scope handling
  • #9360: Both PRs modify TypeScript constructor overload handling at the semantic level by adding constructor-signature node kinds
  • #8479: Both PRs modify semantic\_model/builder.rs to include TypeScript constructor and signature kinds

Suggested labels

A-Core, L-JavaScript

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: addressing a regression in scope tracking within the semantic subsystem.
Description check ✅ Passed The description references the two linked issues (#9483, #9492) that this PR resolves, and mentions that tests were added.
Linked Issues check ✅ Passed The PR directly addresses both issues: the changes add scope tracking for constructor signature nodes, preventing the 'no entry found for key' panic and allowing valid TypeScript constructor overloads to be processed normally.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the reported regression: a test file for the specific issue, a changeset entry, and the core fix in the semantic builder.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/semantic-regression
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/many-hats-shout.md:
- Line 5: Replace the changeset sentence on line 5 with the mandated bug-fix
format starting with "Fixed
[`#9483`](https://github.com/biomejs/biome/issues/9483):" followed by a concise
description; e.g. change the current sentence to "Fixed
[`#9483`](https://github.com/biomejs/biome/issues/9483): noRedeclare no longer
panics on constructor overloads." Ensure the sentence begins with the exact
prefix "Fixed [`#9483`](...):" so it conforms to the project's changeset
guidelines.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b9b1efae-d63b-4f69-a481-dff26cb72284

📥 Commits

Reviewing files that changed from the base of the PR and between f85c069 and 4d557c4.

⛔ Files ignored due to path filters (1)
  • crates/biome_js_analyze/tests/specs/suspicious/noRedeclare/invalid-issue-9483.ts.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/many-hats-shout.md
  • crates/biome_js_analyze/tests/specs/suspicious/noRedeclare/invalid-issue-9483.ts
  • crates/biome_js_semantic/src/semantic_model/builder.rs

"@biomejs/biome": patch
---

Fixed [#9483](https://github.com/biomejs/biome/issues/9483). Now the rule `noRedeclare` doesn't panic when it encounters constructor overloads.
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.

⚠️ Potential issue | 🟡 Minor

Use the required bug-fix changeset sentence format.

Please rewrite Line [5] to use the mandated form with a colon, e.g. Fixed [#9483](...): noRedeclare no longer panics on constructor overloads.
As per coding guidelines "For bug fix changesets, start with 'Fixed [#NUMBER](issue link): ...' format".

🧰 Tools
🪛 LanguageTool

[uncategorized] ~5-~5: Possible missing comma found.
Context: .../github.com//issues/9483). Now the rule noRedeclare doesn't panic wh...

(AI_HYDRA_LEO_MISSING_COMMA)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/many-hats-shout.md at line 5, Replace the changeset sentence on
line 5 with the mandated bug-fix format starting with "Fixed
[`#9483`](https://github.com/biomejs/biome/issues/9483):" followed by a concise
description; e.g. change the current sentence to "Fixed
[`#9483`](https://github.com/biomejs/biome/issues/9483): noRedeclare no longer
panics on constructor overloads." Ensure the sentence begins with the exact
prefix "Fixed [`#9483`](...):" so it conforms to the project's changeset
guidelines.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 17, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 156 skipped benchmarks1


Comparing fix/semantic-regression (4d557c4) with main (60cf024)

Open in CodSpeed

Footnotes

  1. 156 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ematipico ematipico merged commit af39936 into main Mar 17, 2026
18 checks passed
@ematipico ematipico deleted the fix/semantic-regression branch March 17, 2026 13:32
@github-actions github-actions Bot mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Biome panics on valid TypeScript constructor overloads 🐛 Getting panic on execution with multiple constructor function signatures

2 participants