67b9647069
The test already had a reference to the `this` value, but that doesn't show that the *type* is allowed.
23 lines
953 B
Plaintext
23 lines
953 B
Plaintext
tests/cases/conformance/types/thisType/thisTypeErrors2.ts(2,20): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
|
tests/cases/conformance/types/thisType/thisTypeErrors2.ts(9,38): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
|
|
|
|
|
==== tests/cases/conformance/types/thisType/thisTypeErrors2.ts (2 errors) ====
|
|
class Base {
|
|
constructor(a: this) {
|
|
~~~~
|
|
!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
|
}
|
|
}
|
|
class Generic<T> {
|
|
}
|
|
class Derived {
|
|
n: number;
|
|
constructor(public host: Generic<this>) {
|
|
~~~~
|
|
!!! error TS2526: A 'this' type is available only in a non-static member of a class or interface.
|
|
let self: this = this;
|
|
this.n = 12;
|
|
}
|
|
}
|
|
|