16 lines
821 B
Plaintext
16 lines
821 B
Plaintext
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers2.ts(2,18): error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers2.ts(6,18): error TS2334: 'this' cannot be referenced in a static property initializer.
|
|
|
|
|
|
==== 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.
|
|
} |