You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeSomeFunction=(...args: any)=>anytypeSomeMappedTuple<Textendsreadonlyunknown[]|[]>={[PinkeyofT]: Promise<T[P]>}// ok if we put `infer` outside of the type parameter of SomeMappedTupletypeA<TextendsSomeFunction>=Textends(...args: infer P)=>any ? (...args: SomeMappedTuple<P>)=>void : any// error: A rest parameter must be of an array typetypeB<TextendsSomeFunction>=(...args: SomeMappedTuple<Textends(...args: infer P)=>any ? P : any>)=>void// but in both cases there's no error inferring the correct typetypea=A<(a: string,b: number)=>void>typeb=A<(a: string,b: number)=>void>
π Actual behavior
An error is raised for type B: A rest parameter must be of an array type, where the type parameter passed into SomeMappedTuple should be unknown[] or any
π Expected behavior
type B should not raise any error
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground
π» Code
π Actual behavior
An error is raised for type
B
: A rest parameter must be of an array type, where the type parameter passed intoSomeMappedTuple
should beunknown[]
orany
π Expected behavior
type
B
should not raise any errorThe text was updated successfully, but these errors were encountered: