Microsoft/TypeScript
GitHub ã§èŠãIndex type for an intersected `NoInfer` can get sometimes incorrectly deferred
Open
#61,091 opened on 2025幎1æ31æ¥
Domain: Index TypesHelp WantedPossible Improvement
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð Search Terms
noinfer intersection index type keyof deferred deferral
ð Version & Regression Information
- This is the behavior in every version I tried
⯠Playground Link
ð» Code
type Test = keyof (NoInfer<{ foo: string }> & {});
// ^? type Test = keyof (NoInfer<{ foo: string; }> & {})
type Test2 = keyof ({ foo: string } & {});
// ^? type Test2 = "foo"
ð Actual behavior
Test is a deferred index type
ð Expected behavior
Test shouldn't be a deferred index type but a "foo" literal, just like Test2.
Additional information about the issue
No response