microsoft / microsoft/TypeScript

`NoInfer` changes behavior for type matching on spread

Open
#63,627 5 comments 0 reactions 1 assignee View on GitHub

@ahejlsberg is already working on this.

Since Jul 9, 2026.

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

Description

### 🔎 Search Terms

NoInfer spread

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about `NoInfer`

### ⏯ Playground Link

https://www.typescriptlang.org/play/?ts=6.0.3#code/GYVwdgxgLglg9mABAQwE6oIwApkC5EDaYIAtgEYCmqANIgHQMBycAkmMFQDwEC6AfDwCUiAN4BfAFBpMWAhiEBuCRNCRYCFOgBMOfEVKUa9BryGjJ0nXMXLV0eElXY8iLAA98xclVoM6cfGY2DlRufmEAXj5EADc4GAATYXEVcGw3RCjzQSVUtQdEVR0Xd08DH2N-PTMsuMTkySL3TOjxHIkgA

### 💻 Code

```ts
function arr1(a: [number, ...NoInfer<[]>]) {}
arr1([1]);

function arr2(a: [number, ...[]]) {}
arr2([1]);

function fun1(a: (x: number, ...o: NoInfer<[]>) => void) {}
fun1(x => {});

function fun2(a: (x: number, ...o: []) => void) {}
fun2(x => {});
```

### 🙁 Actual behavior

The two function calls to functions with `NoInfer` triggers type error, while the other two to equivalent function without `NoInfer` don't.

### 🙂 Expected behavior

This code should work without type error.

### Additional information about the issue

_No response_

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.