TypeScript/tests/cases/compiler/awaitInClassInAsyncFunction.ts
Klaus Meinhardt 5321dcb09f disallow 'await' and 'yield' in property and enum member initializer (#34892)
* disallow 'await' and 'yield' in property and enum member initializer

* accept baseline changes

* Add a test for #34887

Ensures that this fixes #34887
2019-11-14 17:44:48 -08:00

13 lines
198 B
TypeScript

// @target: esnext
// https://github.com/microsoft/TypeScript/issues/34887
async function bar() {
return 2;
}
async function foo() {
return new class {
baz = await bar();
};
}