Skip to content

Check this params when comparing pseudotype signatures to type signatures#4062

Open
weswigham wants to merge 5 commits into
microsoft:mainfrom
weswigham:pseudotypenodebuilder-this-params
Open

Check this params when comparing pseudotype signatures to type signatures#4062
weswigham wants to merge 5 commits into
microsoft:mainfrom
weswigham:pseudotypenodebuilder-this-params

Conversation

@weswigham
Copy link
Copy Markdown
Member

Fixes #4057

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes an isolated declarations mismatch where pseudo-type signature comparison ignored this parameters, causing incorrect fallback diagnostics for object methods using captured generics in this.

Changes:

  • Adds this parameter-aware comparison for pseudo parameters against checker signatures.
  • Refactors duplicated parameter comparison logic into a shared helper.
  • Adds a compiler regression test and baselines for the captured generic this parameter case.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/checker/pseudotypenodebuilder.go Adds shared pseudo/checker parameter equivalence logic with thisParameter handling.
testdata/tests/cases/compiler/isolatedDeclarationsThisParameterWithCapturedGeneric.ts Adds regression coverage for the issue.
testdata/baselines/reference/compiler/isolatedDeclarationsThisParameterWithCapturedGeneric.js Adds emitted JS and declaration baseline.
testdata/baselines/reference/compiler/isolatedDeclarationsThisParameterWithCapturedGeneric.symbols Adds symbol baseline.
testdata/baselines/reference/compiler/isolatedDeclarationsThisParameterWithCapturedGeneric.types Adds type baseline.

Comment thread internal/checker/pseudotypenodebuilder.go Outdated
Comment thread internal/checker/pseudotypenodebuilder.go
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 7.0 RC milestone May 28, 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.

New isolatedDeclarations error with generic this parameter inference

3 participants