-
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 issue
Milestone
Description
TypeScript Version: 2.3.0-dev.20170328
Code
The following code produces wrong output, when run through tsc, only when target is es6, the "as"-cast exists and the accessor "[x]" exists.
(x) => ({ "1": "one", "2": "two" } as { [key: string]: string })[x];
Expected behavior:
Running "tsc -t es6" on the above code in a .ts file I expect to get a .js file containing:
(x) => ({ "1": "one", "2": "two" })[x];
Actual behavior:
(x) => { "1": "one", "2": "two" }[x];
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue