-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Description
TypeScript Version: v4.0.0-dev.20200708
Search Terms: implicitly index signature map get
Code
interface Foo {
bar: Map<string, string>;
}
declare const foo: Foo;
const nom = foo.bar['nom']; // error on this line
Expected behavior:
The error should say:
Element implicitly has an 'any' type because type 'Map<string, string>' has no index signature. Did you mean to call 'foo.bar.get'?
Actual behavior:
The error says:
Element implicitly has an 'any' type because type 'Map<string, string>' has no index signature. Did you mean to call 'foo.[object Object].get'?
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript