-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
class Foo {
[key: string]: any;
static BAR:string = 'bar';
static BAZ:string = 'baz';
}
console.log(Foo['BAR']);
console.log(Foo['B' + 'A' + 'Z']);
console.log(Foo['qux']);
I get the following errors with this:
tst.ts(8,13): error TS7017: Index signature of object type implicitly has an 'any' type.
tst.ts(9,13): error TS7017: Index signature of object type implicitly has an 'any' type.
I've read in the gitter archives that this should be working. Should it? How can I get a static property value using a dynamic key?
garthk, westy92, JacobEvelyn, joekaiser, loilo and 27 more
Metadata
Metadata
Assignees
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript