microsoft / microsoft/TypeScript

Regression from 4.1.5 to 4.2.3: "Type instantiation is excessively deep and possibly infinite."

Open
#43,337 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Bug Report

The attached playground compiles happily and quickly in Typescript 4.1.5, but fails with "Type instantiation is excessively deep and possibly infinite" in Typescript 4.2.3. Is a conditional distributing that didn't use to?

🔎 Search Terms
🕗 Version & Regression Information
  • This changed between versions 4.1.5 and 4.2.3
  • Fails on nightly as well
⏯ Playground Link

Playground link with relevant code

💻 Code
🙁 Actual behavior

4.2.3: Compilation error
nightly: Compilation error

🙂 Expected behavior

4.1.5: Compiles quickly and works fine

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked TypeScript Playground repro and compare compilation under 4.1.5, 4.2.3, and nightly. Reduce the example to identify the conditional-type or instantiation behavior that changed; use the reduced case to guide investigation in the compiler and add a regression test. Done means the repro compiles successfully without the excessively deep instantiation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.