TypeScript/tests/baselines/reference/thisInOuterClassBody.errors.txt
2014-07-12 17:30:19 -07:00

27 lines
719 B
Plaintext

==== tests/cases/compiler/thisInOuterClassBody.ts (3 errors) ====
class Foo {
x = this;
static y = this;
~~~~
!!! 'this' cannot be referenced in a static property initializer.
bar() {
this.x; // 'this' is type 'Foo'
var f = () => this.x; // 'this' should be type 'Foo' as well
var p = this.y;
~
!!! Property 'y' does not exist on type 'Foo'.
return this;
}
static bar2() {
var a = this.y;
var b = this.x;
~
!!! Property 'x' does not exist on type 'typeof Foo'.
}
}