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

18 lines
347 B
TypeScript

class Foo {
x = "hello";
bar() {
this.x; // 'this' is type 'Foo'
var f = () => this.x; // 'this' should be type 'Foo' as well
}
}
function myFn(a:any) { }
class myCls {
constructor () {
myFn(() => {
myFn(() => {
var x = this;
});
});
}
}