- Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
TypeScript Version: 2.4.2
Code
typeFoo=Readonly<{[n: number]: string;}>;typeBar={readonly[n: number]: string;};functionfoobar(): void{constx: Foo={[0]: 'asdf',[1]: 'fdsa',[-1]: 'dddd',};consty: Bar={[0]: 'qwer',[1]: 'rewq',[-1]: 'eeee',};constz: string=x[0]+y[0];}Expected behavior:
No Error
Actual behavior:
Shows error Element implicitly has an 'any' type because type 'Readonly<{[n: number]: string}>' has no index signature. for x[0].
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code