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
constvar1: string="";constvar2: number=0;// inferred as: const arr: (string | number)[]// this is wrong (?) and should be: const arr: [string, number]constarr=[var1,var2];constarr3: (typeofarr)=["not","ok"];// not okconstbettarr: [string,number]=[var1,var2];constbettarr3: (typeofbettarr)=["not","ok"];// ok
Activity
fatcerberus commentedon Mar 20, 2023
This is working as intended. To infer tuples from an array literal without a type annotation, you have to use
as const.Next time please follow the issue template for bug reports.