1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
=== tests/cases/conformance/expressions/optionalChaining/callChain/callChainInference.ts ===
// Repro from #42404
interface Y {
>Y : Symbol(Y, Decl(callChainInference.ts, 0, 0))
foo<T>(this: T, arg: keyof T): void;
>foo : Symbol(Y.foo, Decl(callChainInference.ts, 2, 13))
>T : Symbol(T, Decl(callChainInference.ts, 3, 8))
>this : Symbol(this, Decl(callChainInference.ts, 3, 11))
>T : Symbol(T, Decl(callChainInference.ts, 3, 8))
>arg : Symbol(arg, Decl(callChainInference.ts, 3, 19))
>T : Symbol(T, Decl(callChainInference.ts, 3, 8))
a: number;
>a : Symbol(Y.a, Decl(callChainInference.ts, 3, 40))
b: string;
>b : Symbol(Y.b, Decl(callChainInference.ts, 4, 14))
}
declare const value: Y | undefined;
>value : Symbol(value, Decl(callChainInference.ts, 8, 13))
>Y : Symbol(Y, Decl(callChainInference.ts, 0, 0))
if (value) {
>value : Symbol(value, Decl(callChainInference.ts, 8, 13))
value?.foo("a");
>value?.foo : Symbol(Y.foo, Decl(callChainInference.ts, 2, 13))
>value : Symbol(value, Decl(callChainInference.ts, 8, 13))
>foo : Symbol(Y.foo, Decl(callChainInference.ts, 2, 13))
}
value?.foo("a");
>value?.foo : Symbol(Y.foo, Decl(callChainInference.ts, 2, 13))
>value : Symbol(value, Decl(callChainInference.ts, 8, 13))
>foo : Symbol(Y.foo, Decl(callChainInference.ts, 2, 13))
|