🔎 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
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.🙁 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
🔎 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