Bug Report
Error happens only when:
- MyInterface extends type alias which represents named array tuple
- MyInterface is generic
- MyType is NAMED tuple
- MyType has
...rest
🔎 Search Terms
type alias, named tuple, interface
🕗 Version & Regression Information
Typescript v4.9.3
⏯ Playground Link
Playground link with relevant code
💻 Code
The following code throws that error:
typeMyType=[name1:string,name2: number,
...rest:any[]]interfaceMyInterface<T>extendsMyType{}// "Interface 'MyInterface<T>' incorrectly extends interface '[name1: string, name2: number, ...rest: any[]]'.All of the following below works fine:
typeMyType=[name1:string,name2: number,
...rest:any[]]interfaceMyInterfaceextendsMyType{//MyInterface is not generic => works}// ----------- OR -------------typeMyType=[// MyType does not have ...rest => works finename1:string,name2: number]interfaceMyInterface<T>extendsMyType{}// ------------ OR ------------typeMyType=[// MyType typle elements are not named => works finestring,number,
...any[]]interfaceMyInterface<T>extendsMyType{}🙁 Actual behavior
TSC throws error:
Interface 'MyInterface<T>' incorrectly extends interface '[name1: string, name2: number, ...rest: any[]]'.
🙂 Expected behavior
Successfull compilation
Bug Report
Error happens only when:
...rest🔎 Search Terms
type alias, named tuple, interface
🕗 Version & Regression Information
Typescript v4.9.3
⏯ Playground Link
Playground link with relevant code
💻 Code
The following code throws that error:
All of the following below works fine:
🙁 Actual behavior
TSC throws error:
🙂 Expected behavior
Successfull compilation