TypeScript/tests/cases/compiler/thisInOuterClassBody.ts
2014-07-12 17:30:19 -07:00

20 lines
321 B
TypeScript

class Foo {
x = this;
static y = this;
bar() {
this.x; // 'this' is type 'Foo'
var f = () => this.x; // 'this' should be type 'Foo' as well
var p = this.y;
return this;
}
static bar2() {
var a = this.y;
var b = this.x;
}
}