-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Conditional TypesThe issue relates to conditional typesThe issue relates to conditional typesDomain: 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
TypeScript Version: 3.2.0-dev.201xxxxx
Search Terms:
generic rest generators
Code
declare function call<Fn extends (...args: any[]) => any>(
fn: Fn,
...args: Parameters<Fn>
): any
call((a: 'a') => {})
call(function*(a: 'a') {})Expected behavior:
call with generator type checks the same way as with plain function i.e. gives type error when args are missing
Actual behavior:
call gives type error when args are missing with plain function, but not with generator
Playground Link:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Conditional TypesThe issue relates to conditional typesThe issue relates to conditional typesDomain: 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