-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
Domain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
Description
π 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
Metadata
Metadata
Assignees
Labels
Domain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases