Skip to content

fix: track dependencies in computed keys of TSMethodSignature#246

Merged
sxzz merged 1 commit into
sxzz:mainfrom
cueaz:fix-ts-method-signature
May 23, 2026
Merged

fix: track dependencies in computed keys of TSMethodSignature#246
sxzz merged 1 commit into
sxzz:mainfrom
cueaz:fix-ts-method-signature

Conversation

@cueaz

@cueaz cueaz commented May 23, 2026

Copy link
Copy Markdown
Contributor
  • This PR contains AI-generated code, but I have carefully reviewed it myself. Otherwise, my PR may be closed.
    • I understand that my PR is more likely to be rejected or requested for changes if it contains AI-generated code that I do not fully understand.

Description

Fixes an issue where dependencies in computed keys of interface methods (e.g., [mod.b](): string) were failing to resolve.

During collectDependenciesTSPropertySignature was handled, but TSMethodSignature was missing from the isTypeOf check. This caused the linker to silently ignore computed keys for interface methods.

Test Case

mod.ts
export const a = 'aa'
export const b = 'bb'
export const c = 'cc'
index.ts
import * as mod from './mod'

export interface Test {
  [mod.a]: string // TSPropertySignature
  [mod.b](): string // TSMethodSignature(kind=method)
  get [mod.c](): string // TSMethodSignature(kind=get)
}
Actual (Failing):
declare const a = "aa";
declare const b = "bb";
declare const c = "cc";
interface Test {
  [a]: string;
  [mod.b](): string; // ignored
  get [mod.c](): string; // ignored
}
export { Test };
Expected:
declare const a = "aa";
declare const b = "bb";
declare const c = "cc";
interface Test {
  [a]: string;
  [b](): string;
  get [c](): string;
}
export { Test };

@pkg-pr-new

pkg-pr-new Bot commented May 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/rolldown-plugin-dts@246

commit: 144597a

@sxzz sxzz enabled auto-merge (squash) May 23, 2026 07:30
@sxzz sxzz merged commit b791b1f into sxzz:main May 23, 2026
11 checks passed
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