==== 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'. } }