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
Allowing indexing of indexable interfaces act similar to ES6 Map.get seems like it would help the type safety of the language.
Example:
interface Foo {
[name: string]: number
}
let foo: Foo = {};
let baz = foo["bar"];
// baz is of type number and compiles fine, even though is actually undefined
// possibly make baz of type (number | undefined) instead
Expected Behavior:
baz is of type (number | undefined)
Actual Behavior:
baz is of type number, despite actually being type undefined
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.1.4
Allowing indexing of indexable interfaces act similar to ES6 Map.get seems like it would help the type safety of the language.
Example:
Expected Behavior:
baz is of type (number | undefined)
Actual Behavior:
baz is of type number, despite actually being type undefined
The text was updated successfully, but these errors were encountered: