|
| 1 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(3,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 2 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(3,21): error TS1308: 'await' expression is only allowed within an async function. |
| 3 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(4,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 4 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(4,28): error TS1308: 'await' expression is only allowed within an async function. |
| 5 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(6,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 6 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(6,21): error TS1163: A 'yield' expression is only allowed in a generator body. |
| 7 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(7,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 8 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(7,28): error TS1163: A 'yield' expression is only allowed in a generator body. |
| 9 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(11,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 10 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(11,21): error TS1308: 'await' expression is only allowed within an async function. |
| 11 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(12,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 12 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(12,28): error TS1308: 'await' expression is only allowed within an async function. |
| 13 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(14,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 14 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(14,21): error TS1163: A 'yield' expression is only allowed in a generator body. |
| 15 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(15,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 16 | +tests/cases/conformance/classes/awaitAndYieldInProperty.ts(15,28): error TS1163: A 'yield' expression is only allowed in a generator body. |
| 17 | + |
| 18 | + |
| 19 | +==== tests/cases/conformance/classes/awaitAndYieldInProperty.ts (16 errors) ==== |
| 20 | + async function* test(x: Promise<string>) { |
| 21 | + class C { |
| 22 | + [await x] = await x; |
| 23 | + ~~~~~~~~~ |
| 24 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 25 | + ~~~~~ |
| 26 | +!!! error TS1308: 'await' expression is only allowed within an async function. |
| 27 | + static [await x] = await x; |
| 28 | + ~~~~~~~~~ |
| 29 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 30 | + ~~~~~ |
| 31 | +!!! error TS1308: 'await' expression is only allowed within an async function. |
| 32 | + |
| 33 | + [yield 1] = yield 2; |
| 34 | + ~~~~~~~~~ |
| 35 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 36 | + ~~~~~ |
| 37 | +!!! error TS1163: A 'yield' expression is only allowed in a generator body. |
| 38 | + static [yield 3] = yield 4; |
| 39 | + ~~~~~~~~~ |
| 40 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 41 | + ~~~~~ |
| 42 | +!!! error TS1163: A 'yield' expression is only allowed in a generator body. |
| 43 | + } |
| 44 | + |
| 45 | + return class { |
| 46 | + [await x] = await x; |
| 47 | + ~~~~~~~~~ |
| 48 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 49 | + ~~~~~ |
| 50 | +!!! error TS1308: 'await' expression is only allowed within an async function. |
| 51 | + static [await x] = await x; |
| 52 | + ~~~~~~~~~ |
| 53 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 54 | + ~~~~~ |
| 55 | +!!! error TS1308: 'await' expression is only allowed within an async function. |
| 56 | + |
| 57 | + [yield 1] = yield 2; |
| 58 | + ~~~~~~~~~ |
| 59 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 60 | + ~~~~~ |
| 61 | +!!! error TS1163: A 'yield' expression is only allowed in a generator body. |
| 62 | + static [yield 3] = yield 4; |
| 63 | + ~~~~~~~~~ |
| 64 | +!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type. |
| 65 | + ~~~~~ |
| 66 | +!!! error TS1163: A 'yield' expression is only allowed in a generator body. |
| 67 | + } |
| 68 | + } |
0 commit comments