49 lines
825 B
Plaintext
49 lines
825 B
Plaintext
=== tests/cases/compiler/thisInInnerFunctions.ts ===
|
|
class Foo {
|
|
>Foo : Foo
|
|
|
|
x = "hello";
|
|
>x : string
|
|
|
|
bar() {
|
|
>bar : () => void
|
|
|
|
function inner() {
|
|
>inner : () => void
|
|
|
|
this.y = "hi"; // 'this' should be not type to 'Foo' either
|
|
>this.y = "hi" : string
|
|
>this.y : any
|
|
>this : any
|
|
>y : any
|
|
|
|
var f = () => this.y; // 'this' should be not type to 'Foo' either
|
|
>f : () => any
|
|
>() => this.y : () => any
|
|
>this.y : any
|
|
>this : any
|
|
>y : any
|
|
}
|
|
}
|
|
}
|
|
|
|
function test() {
|
|
>test : () => void
|
|
|
|
var x = () => {
|
|
>x : () => void
|
|
>() => { (() => this)(); this; } : () => void
|
|
|
|
(() => this)();
|
|
>(() => this)() : any
|
|
>(() => this) : () => any
|
|
>() => this : () => any
|
|
>this : any
|
|
|
|
this;
|
|
>this : any
|
|
|
|
};
|
|
}
|
|
|