1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
=== tests/cases/compiler/awaitInClassInAsyncFunction.ts ===
// https://github.com/microsoft/TypeScript/issues/34887
async function bar() {
>bar : () => Promise<number>
return 2;
>2 : 2
}
async function foo() {
>foo : () => Promise<(Anonymous class)>
return new class {
>new class { baz = await bar(); } : (Anonymous class)
>class { baz = await bar(); } : typeof (Anonymous class)
baz = await bar();
>baz : number
>await bar() : number
>bar() : Promise<number>
>bar : () => Promise<number>
};
}
|