Skip to content

Prevent panic when serializing decorator contextual signatures - #64904

Draft
Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-get-signatures-of-type-panic
Draft

Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-get-signatures-of-type-panic

Conversation

Copilot AI commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Calling getSignaturesOfType on a decorator’s contextual type panics when serialization tries to create a node handle for a synthetic declaration without a source file.

  • Serialization: Omit source-less signature declarations from API responses while preserving their internal checker representation.
  • Regression coverage: Add async and generated sync API tests verifying the call signature, its parameters, and the absent declaration.

@typescript-automation typescript-automation Bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Oct 21, 2026
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug and removed For Milestone Bug PRs that fix a bug with a specific milestone labels Oct 21, 2026
Copilot AI and others added 2 commits October 21, 2026 17:32
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix panic in getSignaturesOfType on decorators' contextual types Prevent panic when serializing decorator contextual signatures Oct 21, 2026
@weswigham

Copy link
Copy Markdown
Member

Copilot this looks more like a workaround - consider where synthetic signature declarations come from in the checker and if they just need to be made a wee bit less synthetic to be serialized by the API

Copilot AI and others added 2 commits October 21, 2026 18:57
Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>

Copilot AI commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Copilot this looks more like a workaround - consider where synthetic signature declarations come from in the checker and if they just need to be made a wee bit less synthetic to be s...

Reworked in a6da8d9 and f7d20b6: synthetic call-signature declarations now belong to a shared virtual source-file AST, so the API returns resolvable declarations rather than omitting them. Their positions remain synthesized to preserve checker/node-builder behavior, and the virtual file stays outside program inputs. Async/sync tests cover declaration resolution and checker round-tripping. npx hereby validate --api passes.

@weswigham

Copy link
Copy Markdown
Member

Interesting.

Andrew Branch (@andrewbranch) how do you feel about this approach?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in getSignaturesOfType on a decorator's contextual type in JS API

3 participants