diff --git a/tests/baselines/reference/thisTypeErrors2.errors.txt b/tests/baselines/reference/thisTypeErrors2.errors.txt index cdb49b877df..783325f4ef3 100644 --- a/tests/baselines/reference/thisTypeErrors2.errors.txt +++ b/tests/baselines/reference/thisTypeErrors2.errors.txt @@ -16,6 +16,7 @@ tests/cases/conformance/types/thisType/thisTypeErrors2.ts(9,38): error TS2526: A constructor(public host: Generic) { ~~~~ !!! 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; } } diff --git a/tests/baselines/reference/thisTypeErrors2.js b/tests/baselines/reference/thisTypeErrors2.js index 476e2039996..f48d0874e53 100644 --- a/tests/baselines/reference/thisTypeErrors2.js +++ b/tests/baselines/reference/thisTypeErrors2.js @@ -8,6 +8,7 @@ class Generic { class Derived { n: number; constructor(public host: Generic) { + let self: this = this; this.n = 12; } } @@ -27,6 +28,7 @@ var Generic = (function () { var Derived = (function () { function Derived(host) { this.host = host; + var self = this; this.n = 12; } return Derived; diff --git a/tests/cases/conformance/types/thisType/thisTypeErrors2.ts b/tests/cases/conformance/types/thisType/thisTypeErrors2.ts index b30a554bd88..d29e714c4d0 100644 --- a/tests/cases/conformance/types/thisType/thisTypeErrors2.ts +++ b/tests/cases/conformance/types/thisType/thisTypeErrors2.ts @@ -7,6 +7,7 @@ class Generic { class Derived { n: number; constructor(public host: Generic) { + let self: this = this; this.n = 12; } }