Closed
Description
TypeScript Version: 2.4.1 /
Code
enum Things {
ONE = "one",
TWO = "two"
}
type ThingMap = { [TKey in Things]: any };
const thingMap: ThingMap = {
one: null,
two: null
};
function setThing(thing: Things, something: any) {
thingMap[thing] = something;
}
Expected behavior:
Just like I can do thingMap[Things.ONE] = 'blah'
without any errors, this should not throw an error.
Actual behavior:
src/test.ts(14,2): error TS7017: Element implicitly has an 'any' type because type 'ThingMap' has no index signature.