TypeScript/tests/baselines/reference/awaitAndYield.errors.txt

15 lines
741 B
Plaintext

tests/cases/conformance/enums/awaitAndYield.ts(3,15): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
tests/cases/conformance/enums/awaitAndYield.ts(4,15): error TS1163: A 'yield' expression is only allowed in a generator body.
==== tests/cases/conformance/enums/awaitAndYield.ts (2 errors) ====
async function* test(x: Promise<number>) {
enum E {
foo = await x,
~~~~~
!!! error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
baz = yield 1,
~~~~~
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
}
}