TypeScript/tests/cases/compiler/thisInInnerFunctions.ts

17 lines
340 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
class Foo {
x = "hello";
bar() {
function inner() {
this.y = "hi"; // 'this' should be not type to 'Foo' either
var f = () => this.y; // 'this' should be not type to 'Foo' either
}
}
}
function test() {
var x = () => {
(() => this)();
this;
};
}