Closed
Description
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms: invalid await in constructor
Code
async function bar() {
return 2;
}
async function foo() {
return new class {
baz = await bar();
};
}
Expected behavior:
Error, as await
cannot be used in a constructor
Actual behavior:
Invalid JS code is generated, as a constructor using await bar();
is generated, and this is not allowed in JS
Related Issues: None