-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 4.1.0-dev.20200917
Search Terms: is:issue is:open async label:bug change
Code
async function bar () {
return {
a: await Promise.resolve(1),
b: await Promise.resolve(2),
c: await Promise.resolve(3),
d: await Promise.resolve(4),
e: await Promise.resolve(5),
f: await Promise.resolve(6),
g: await Promise.resolve(7),
h: await Promise.resolve(8),
// works correctly if you comment the next line
i: await Promise.resolve(9),
}
}
bar().then(console.log)
tsconfig.json
{
"compilerOptions": {
"lib": ["DOM", "ES2015"]
}
}
Expected behavior:
{ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9 }
Actual behavior:
{ a: 9, b: 9, c: 9, d: 9, e: 9, f: 9, g: 9, h: 9, i: 9 }
Related Issues:
#40047
barrutko, msieczko, xitronix, rzadp, IllusionMH and 12 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue