Closed
Description
TypeScript Version: 2.7.0-dev.201xxxxx
Code
interface Model {
'0': number
}
const key = '0';
const keyLiteral: '0' = '0';
const myModel = {
'0': 9
}
const { [key]: iendupAsAny } = myModel;
const { [keyLiteral]: iEndupAnyAsWell } = myModel;
const { ['0']: meImWellTyped } = myModel;
Expected behavior:
I would expect the 3 fields to be typed as number or a typescript error since noImplicitAny is true
Actual behavior:
the first 2 end up as any