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
{{ message }}
Repository navigation
Inconsistent Treatment of Shorthand Functions #11062
// A *self-contained* demonstration of the problem follows...functiontestFunction(x: string|Function): any{if(typeofx==='string'){return{key: function(a: any,b: any){// Fine, x is stringreturna[x];}};return{key(a: any,b: any){// Fails, x is string | Function herereturna[x];}};}}
Expected behavior:
Compiles fine
Actual behavior:
Error: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'.
Activity
mhegazy commentedon Sep 22, 2016
duplicate of #10501