FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[api] Fix crash accessing tuple type reference data by andrewbranch · Pull Request #64080 · microsoft/TypeScript · GitHub

[api] Fix crash accessing tuple type reference data - #64080

Merged
Andrew Branch (andrewbranch) merged 4 commits into
microsoft:mainfrom
andrewbranch:tuple-type-reference
Aug 28, 2026
Merged

[api] Fix crash accessing tuple type reference data#64080
Andrew Branch (andrewbranch) merged 4 commits into
microsoft:mainfrom
andrewbranch:tuple-type-reference

Conversation

Andrew Branch (andrewbranch) commented Aug 28, 2026
edited
Loading

Copy link
Copy Markdown
Member

Fixes #63869
Fixes #64065
Closes #64066

The client-side API now has

t.isTypeReference();   // true, let's say
t.isTupleTypeTarget(); // false, let's say

if (t.isTupleType()) {
  t;                            // TupleTypeReference
  const target = t.getTarget(); // TupleType
  target.fixedLength;           // boolean

  target.isTupleTypeTarget();    // true
  target.isTupleType();          // true
  target.getTarget() === target; // true
}

Copilot AI balanced review requested due to automatic review settings August 28, 2026 17:44
github-project-automation Bot moved this to Not started in PR Backlog Aug 28, 2026

Copilot AI left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copy link
Copy Markdown
Member

Hmm, seems like isTupleType now means different things between the function by that name in the checker and the exposed API function. From the checker's point of view, isTupleType returns true if the given type is a type reference to a synthesized tuple base class (which will have ObjectFlagsTuple set). But, if I'm not mistaken, that's what isTupleTypeReference in the API now does. And I'm not quite sure what the API's isTupleType does?

Anders Hejlsberg (ahejlsberg) commented Aug 28, 2026
edited
Loading

Copy link
Copy Markdown
Member

I should add here that a synthesized tuple base class instance also serves as a type reference to itself. So, the synthesized tuple base class has both ObjectFlagsTuple and ObjectFlagsReference set. This is the same pattern as regular class and interface types.

Andrew Branch (andrewbranch) changed the title [api] Clear up the difference between tuple types and tuple type references [api] Fix crash accessing tuple type reference data Aug 28, 2026

Copilot AI left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if this is what Anders was saying made sense

github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Aug 28, 2026
Andrew Branch (andrewbranch) added this pull request to the merge queue Aug 28, 2026
Merged via the queue into microsoft:main with commit 444de10 Aug 28, 2026
25 checks passed
Andrew Branch (andrewbranch) deleted the tuple-type-reference branch August 28, 2026 20:11
github-project-automation Bot moved this from Needs merge to Done in PR Backlog Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add TupleTypeReference interface to the API checker.getTypeAtLocation panics for an array literal contextually typed by an empty tuple

4 participants


Back | FazBrowse Home | New Git URL