microsoft / microsoft/TypeScript
Broken assignability and quick info due to erroneously deferring keyof T since #51621
@gabritto is already working on this.
Since Apr 30, 2026.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Note: This is a refiling of #61728 due to being closed due to being related to quick info display (see #62827).
### Version & Regression Information
This changed in PR https://github.com/microsoft/TypeScript/pull/51621
### Playground Link
https://www.typescriptlang.org/play/?ts=5.8.3#code/C4TwDgpgBAQghgZwJYGMDCB7AdgEycJbOAGwB4AVAPigF4oBrCEDAMynKggA9gJcEocLCABQUKAH4owAE4BXCGKgAuKCxIIIAbhEjQkKJiwskAc1pQA3lBkQAVhBTA0xDJtWyFUAL4790cggEYFolIxNzbl5+K28lcSlLePEU2wcnFzcIVXhkdGw8AiIycLNKHRSUuMrVLAgANwgZHT1waAAle0dnV00LQOCAbQAiNO7MzWGAXR0AelmUgD0pRmY2UsiePhwBIRBJaXloVXViTSA
### Code:
Poor quick info:
```ts
type BasicConditional = keyof T extends any
? true
: false;
type Config = { rejectClose: true };
type Test =
Config extends {}
? {
rejectClose: BasicConditional;
}
: never;
type RejectClose = Test["rejectClose"];
// ^? keyof Config extends any ? true : false
```
Broken assignability (found by @Andarist, see https://github.com/microsoft/TypeScript/issues/61728#issuecomment-2891710775)
```ts
type BasicConditional = keyof T extends infer R ? R : never;
type Config = { rejectClose: true };
type Test = Config extends {}
? {
rejectClose: BasicConditional;
}
: never;
const test: Test["rejectClose"] = "rejectClose";
// ^ Type 'string' is not assignable to type 'BasicConditional'.
const ok: BasicConditional = "rejectClose"; // No error
```
### Actual behavior
`RejectClose`'s quick info is `keyof Config extends any ? true : false` which is un-simplified and rather ugly. In addition in the second snippet `const test: Test["rejectClose"] = "rejectClose";` fails.
### Expected behavior
The quick info should look nice and `const test: Test["rejectClose"] = "rejectClose";` should succeed.
See https://github.com/microsoft/TypeScript/pull/61999 for a TS-JS based fix.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.