Microsoft/TypeScript
GitHub ã§èŠãIncorrect report of self-referencing type for static fields
Open
#62,552 opened on 2025幎10æ6æ¥
Domain: check: Type InferenceHelp WantedPossible Improvement
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð Search Terms
TS7022 implicitly has type 'any'
ð Version & Regression Information
- The issue applies to all TypeScript 5 versions and TypeScript 6 nightly
⯠Playground Link
ð» Code
function id<T>(x: T): T {
return x
}
const Foo = id(class {
static readonly foo = id(42) // Error TS7022
})
const Ok = class {
static readonly foo = id(42) // No error
}
ð Actual behavior
Type error TS7022 reported
ð Expected behavior
No type error
Additional information about the issue
No response