12 lines
459 B
Plaintext
12 lines
459 B
Plaintext
==== tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers2.ts (2 errors) ====
|
|
class C {
|
|
static foo = this; // error
|
|
~~~~
|
|
!!! error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
}
|
|
|
|
class C2<T> {
|
|
static foo = this; // error
|
|
~~~~
|
|
!!! error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
} |