Microsoft/TypeScript
Auf GitHub ansehenIncorrect report of self-referencing type for static fields
Open
#62.552 geöffnet am 6. Okt. 2025
Domain: check: Type InferenceHelp WantedPossible Improvement
Repository-Metriken
- Stars
- (48.455 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)
Beschreibung
🔎 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