We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 2.6.0-dev.201xxxxx
Code
enum StringEnum { Name = 'NAME', Email = 'EMAIL' } type EnumKeyed = { [K in StringEnum]: string; } const obj: EnumKeyed = { NAME: 'aValue', EMAIL: 'bValue' }; const array = Object.keys(obj) as Array<StringEnum>; const result = array.map((key: StringEnum) => obj[key]);
Expected behavior: result // ['aValue', 'bValue']; Actual behavior:
result // ['aValue', 'bValue'];
TS throws:
Element implicitly has an 'any' type because type 'EnumKeyed' has no index signature. const obj: EnumKeyed
The text was updated successfully, but these errors were encountered:
This looks like a duplicate of #16760 which is already fixed in 2.6. It doesn't reproduce with typescript@next. Are you sure you're on version 2.6?
typescript@next
Sorry, something went wrong.
Ah, apologies, was running on typescript@latest. This is fixed in @2.6.0-dev.20171013. Thanks so much @ahejlsberg
No branches or pull requests
TypeScript Version: 2.6.0-dev.201xxxxx
Code
Expected behavior:
result // ['aValue', 'bValue'];
Actual behavior:
TS throws:
The text was updated successfully, but these errors were encountered: