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
typeReplace<Textends[...any],A,B>={[KinkeyofT]: T[K]extendsA ? B : T[K];};typeReplaceParams<Textends[...any],A,B>=(...args:Replace<[number,number],A,B>)=>any;//is oktypeReplaceParams1<ARRAYextends[...any],A,B>=(...args:Replace<ARRAY,A,B>)=>any;//failed A rest parameter must be of an array type.typeReplaceParams2<Textends(...arg:any)=>any,A,B>=(...args:Replace<Parameters<T>,A,B>)=>any;//failed A rest parameter must be of an array type.typeRemapped<Textends[...any]>={[KinkeyofT]:T[K]}typeSimpleCase<Textends[...any]>=(...args:Remapped<T>)=>any;//failed A rest parameter must be of an array type.
π Search Terms
rest parameters tuple array generic
π Version & Regression Information
I tried some versions from 3.3.3 to 5.2.2 and Nightly version γnone of them fixed this problem.
β― Playground Link
https://www.typescriptlang.org/play?ts=5.2.2&ssl=13&ssc=119&pln=1&pc=1#code/ATAuE8AcFNgJWpANgQwMbQDwBVjQB6jQB2AJgM7ADaAdHSseALoA0wAgmwEIB8wAvMADeAWABQIEFQDSwAJbFgAa2jgA9gDNg2JgC5tMpnkIkKHYAH5gXYPuyGA3OJABfJ2OdgosBMnTQABRQAJxQAW3IcYyIySlp6RlZOXn4ACjoaEIBzcl1fVAxMKmIAVzCAI2hgllKKqqSWXgBKfh4GcAcAek65SjUlTwgYeEQCwJDw8gBGTHY4OHYATWjTOIz2hpT0+mCcvNH-WfmllmSeFrbGLs6NFDkkaFJzYOhyUGBICbDoImDgMJKb2AlWAmmADHBwVC4C8MBog28Iz8GCCoQiACYogQYmZtpldrp2hd2qdGjw0utdrl8odUeEflVItgeKTmq12g5gN1bvdHs9Xu9PmiGX8AUCQWCISFobDoPCPAqQEMfNAwihIDBSFiTLFqOtEnx+KIJJIZPJFCp1FodLp7NImJ4XAjhgBlORhZDQADCKHIWFw2NWeoSzENwDx2WpqvVmpw53ZV25dweT3YwBeQKF9N+-0B7wlWilUJQMOVNCAA
π» Code
π Actual behavior
this was happend at latest version 5.2.2
and in the next version still no fixed
π Expected behavior
quite sure tuple or array type can be passed to function rest pamaters. but remapped cant.this make replace certain type in parameters inpossible.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: