-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolution
Milestone
Description
Bug Report
π Search Terms
ConstructorParameters Target requires 1 element(s) but source may have fewer.
π Version & Regression Information
4.5.4
newest - 4.7.0-dev.20220305
β― Playground Link
π» Code
function resolve<K, T extends new (...args: any[]) => K>(
constructor: T,
constructorParamsCallable: () => ConstructorParameters<T>,
): K {
return {} as K;
}
class SomeClass {
public constructor(
private readonly someDependency: string,
) {
}
}
resolve(SomeClass, () => ["Hello World!"]);π Actual behavior
Error "Target requires 1 element(s) but source may have fewer.".
π Expected behavior
I think it just should working like it working, when ConstructorParameters is without callable method -> https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABAJwKYGc4BsBuqA8A0gDSIAqiqAHlKmACbqJioDuiAFAHQ8CGyAc3QAuRLzABPANoBdAJSIAvAD5EhZRwCwAKER7EEBOijIQ0OMlFliO-QaMmzUCwAV+vALboAwryxZeACMsVFFvB1NzZDdkT1RaZHR8MmUbbTlRQkQAb1t9NCgQZCRsgF8xJkIAbh1SnXrtCAD0JgBlOA9Ub2amXN19AAcQYJgIezBjSOdkLX67PQHkGBxeWhRUXnoELAlETE6AEVQBuno6CAlRSZgwATS7BT68vTrtV500TFxUDnbO7t4LVIUgARAAJVD+OCIADqFiw9AAhCD5FUgA
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolution