Skip to content

🐛 Biome panics on valid TypeScript constructor overloads #9492

@xaviergonz

Description

@xaviergonz

Environment information

Details
  Version:                      2.4.7
  Color support:                false

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:                    unset
  BIOME_LOG_PREFIX_NAME:             unset
  BIOME_LOG_LEVEL:                   unset
  BIOME_LOG_KIND:                    unset
  BIOME_CONFIG_PATH:                 unset
  BIOME_THREADS:                     unset
  BIOME_WATCHER_KIND:                unset
  BIOME_WATCHER_POLLING_INTERVAL:    unset
  NO_COLOR:                     1
  TERM:                         dumb
  JS_RUNTIME_VERSION:           v25.8.1
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       Not set
  Path:                         unset

Workspace:
  Open Documents:               0

What happened?

  1. Create a file named constructor-overload.ts with this content:
export class Example {
  constructor(value: string)
  constructor(value: string[])
  constructor(value: string | string[]) {
    void value
  }
}
  1. Run:
biome lint constructor-overload.ts
  1. Biome crashes with an internal error:
Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue.
When opening the issue, please provide a minimal reproduction, or identify and share the file/code that triggers it. Without a way to reproduce the error, the error can't be fixed:

Source Location: crates/biome_js_semantic/src/semantic_model/scope.rs:150:38
Thread Name: biome::workspace_worker_0
Message: no entry found for key
Stack Trace: Re-run with `RUST_BACKTRACE=1` to capture the stack trace

constructor-overload.ts internalError/panic  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × processing panicked: no entry found for key
  
  ! This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.
  1. The same file compiles successfully with TypeScript:
tsc --noEmit --strict --target es2022 --module esnext constructor-overload.ts
  1. In my real codebase, replacing the constructor overloads with a single tuple-union rest-parameter signature avoids the Biome crash, so this seems specific to the overload declaration form rather than the runtime logic.

Expected result

It should not throw an internal error. Biome should lint/check the file normally, or at worst report a regular diagnostic if there is a real issue with the code.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-Needs triageStatus: this issue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions