-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 2.3.0-dev.20170415
{
"compilerOptions": {
"strict": true
}
}
Code
declare const x: {
'': string;
'a': string;
'a-b': string;
}
x[''] // error TS7017: Element implicitly has an 'any' type because type '{ '': string; 'a': string; 'a-b': string; }' has no index signature.
x['a'] // fine
x['a-b'] // fine
Expected behavior:
no error
Actual behavior:
error TS7017: Element implicitly has an 'any' type because type '{ '': string; 'a': string; 'a-b': string; }' has no index signature.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this