microsoft / microsoft/TypeScript

Crash: TypeError: Cannot read properties of undefined (reading 'aliasSymbol') remains when using variadic tuple with (infer C)[] and constrained infer

Open
#63,199 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Domain: Crashes
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

### 🔎 Search Terms

aliasSymbol, inferFromTypes, variadic tuple, compiler crash

### 🕗 Version & Regression Information

Version: 5.7.3, 5.8.3, 5.9.3,nightly (Still crashing after PR for #63014 )

### ⏯ Playground Link

https://www.typescriptlang.org/zh/play/?target=7&ts=5.9.3#code/C4TwDgpgBAygrgIwCpzAHiQPigXikqCAD2AgDsATAZygG0AoKJqAOjYAoBLMgMwgCcoAYQCUtALoAaRszYtufQQCFCJctToBDMiElRtIcfXFQA-FBUAuKGQgA3AQG56oSPn6cA5p4G5YiFHRaAEY9ACZxTEcgA

### 💻 Code

```ts
type SubTup = T extends [
...(infer C)[],
...infer B extends [any, any]
] ? B : never;
type Trigger = SubTup<[1, 2]>;
```

### 🙁 Actual behavior

```
TypeError: Cannot read properties of undefined (reading 'aliasSymbol')
at inferFromTypes (D:\github\TypeScript\built\local\_tsc.js:68686:18)
at inferFromObjectTypes (D:\github\TypeScript\built\local\_tsc.js:69171:23)
at invokeOnce (D:\github\TypeScript\built\local\_tsc.js:68878:9)
at inferFromTypes (D:\github\TypeScript\built\local\_tsc.js:68840:11)
at inferTypes (D:\github\TypeScript\built\local\_tsc.js:68674:5)
at getConditionalType (D:\github\TypeScript\built\local\_tsc.js:62706:11)
at getConditionalTypeInstantiation (D:\github\TypeScript\built\local\_tsc.js:63695:307)
at instantiateTypeWorker (D:\github\TypeScript\built\local\_tsc.js:63798:14)
at instantiateTypeWithAlias (D:\github\TypeScript\built\local\_tsc.js:63735:20)
at getTypeAliasInstantiation (D:\github\TypeScript\built\local\_tsc.js:60300:52)

Node.js v22.19.0
```

### 🙂 Expected behavior

The compiler should not crash.

### Additional information about the issue

I noticed that while PR #63014 fixed some crashes related to variadic tuples, the compiler still crashes (ICE) when using a slightly different syntax.

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

Reproduce the variadic-tuple snippet from the Playground link or in the compiler, then trace the stack through built/local/_tsc.js, especially inferFromTypes and inferFromObjectTypes. Compare the remaining failure with PR #63014; done means the example no longer produces the aliasSymbol TypeError or crashes the compiler.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.