=== tests/cases/compiler/thisInInnerFunctions.ts === class Foo { >Foo : Symbol(Foo, Decl(thisInInnerFunctions.ts, 0, 0)) x = "hello"; >x : Symbol(x, Decl(thisInInnerFunctions.ts, 0, 11)) bar() { >bar : Symbol(bar, Decl(thisInInnerFunctions.ts, 1, 16)) function inner() { >inner : Symbol(inner, Decl(thisInInnerFunctions.ts, 2, 11)) this.y = "hi"; // 'this' should be not type to 'Foo' either var f = () => this.y; // 'this' should be not type to 'Foo' either >f : Symbol(f, Decl(thisInInnerFunctions.ts, 5, 15)) } } } function test() { >test : Symbol(test, Decl(thisInInnerFunctions.ts, 8, 1)) var x = () => { >x : Symbol(x, Decl(thisInInnerFunctions.ts, 11, 7)) (() => this)(); this; }; }