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
declareconsttextMap: {[key: string]: string}functiongetText(input: string){const{[input]: rawText=input}=textMap// rawText inferred as 'any' and not 'string'}
Expected behavior: rawText to be inferred as string
Actual behavior: rawText inferred as any
As this is a destructuring pattern, it is actually not possible at all to declare the type of rawText other than by making rawText a let declaration first and running an destructuring expression, or otherwise writing equivalent code that does not use destructuring.