With the following code, and the noImplicitAny flag on, I get the error TS7017: Index signature of object type implicitly has an 'any' type.
interface ICurrency {
[key: string]: any;
currencyId:number;
// ...
}
class Currency implements ICurrency {
public currencyId:number;
// ...
}
let currency = new Currency();
let x = 'currencyId';
console.log(currency[x]); // error
console.log(currency['currencyId']); // ok
Surely that's a bug?
With the following code, and the
noImplicitAnyflag on, I get the errorTS7017: Index signature of object type implicitly has an 'any' type.Surely that's a bug?