mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
65 lines
2.0 KiB
Plaintext
65 lines
2.0 KiB
Plaintext
classStaticBlock7.ts(3,9): error TS18037: 'await' expression cannot be used inside a class static block.
|
|
classStaticBlock7.ts(4,9): error TS1163: A 'yield' expression is only allowed in a generator body.
|
|
classStaticBlock7.ts(5,9): error TS18041: A 'return' statement cannot be used inside a class static block.
|
|
classStaticBlock7.ts(12,13): error TS18037: 'await' expression cannot be used inside a class static block.
|
|
classStaticBlock7.ts(24,13): error TS1163: A 'yield' expression is only allowed in a generator body.
|
|
classStaticBlock7.ts(36,13): error TS18041: A 'return' statement cannot be used inside a class static block.
|
|
|
|
|
|
==== classStaticBlock7.ts (6 errors) ====
|
|
class C {
|
|
static {
|
|
await 1;
|
|
~~~~~~~
|
|
!!! error TS18037: 'await' expression cannot be used inside a class static block.
|
|
yield 1;
|
|
~~~~~
|
|
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
|
return 1;
|
|
~~~~~~
|
|
!!! error TS18041: A 'return' statement cannot be used inside a class static block.
|
|
}
|
|
}
|
|
|
|
async function f1 () {
|
|
class C {
|
|
static {
|
|
await 1;
|
|
~~~~~~~
|
|
!!! error TS18037: 'await' expression cannot be used inside a class static block.
|
|
|
|
async function ff () {
|
|
await 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function * f2 () {
|
|
class C {
|
|
static {
|
|
yield 1;
|
|
~~~~~
|
|
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
|
|
|
function * ff () {
|
|
yield 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function f3 () {
|
|
class C {
|
|
static {
|
|
return 1;
|
|
~~~~~~
|
|
!!! error TS18041: A 'return' statement cannot be used inside a class static block.
|
|
|
|
function ff () {
|
|
return 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|