TypeScript/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.symbols

77 lines
5.2 KiB
Plaintext
Raw Normal View History

=== tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts ===
interface A { x }
>A : Symbol(A, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 0, 0))
>x : Symbol(A.x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 0, 13))
interface B { x; y }
>B : Symbol(B, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 0, 17))
>x : Symbol(B.x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 1, 13))
>y : Symbol(B.y, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 1, 16))
interface C { z }
>C : Symbol(C, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 1, 20))
>z : Symbol(C.z, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 2, 13))
interface D { q }
>D : Symbol(D, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 2, 17))
>q : Symbol(D.q, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 3, 13))
class G<T extends A> {
>G : Symbol(G, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 3, 17))
>T : Symbol(T, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 5, 8))
>A : Symbol(A, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 0, 0))
constructor(x: T) { }
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 6, 16))
>T : Symbol(T, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 5, 8))
}
declare function foo(arg: (x: D) => number): string;
>foo : Symbol(foo, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 7, 1), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 52), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 49))
>arg : Symbol(arg, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 21))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 27))
>D : Symbol(D, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 2, 17))
declare function foo(arg: (x: C) => any): string;
>foo : Symbol(foo, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 7, 1), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 52), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 49))
>arg : Symbol(arg, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 21))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 27))
>C : Symbol(C, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 1, 20))
declare function foo(arg: (x: B) => any): number;
>foo : Symbol(foo, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 7, 1), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 52), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 49))
>arg : Symbol(arg, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 11, 21))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 11, 27))
>B : Symbol(B, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 0, 17))
var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked.
>result : Symbol(result, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 13, 3))
>foo : Symbol(foo, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 7, 1), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 52), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 49))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 13, 25))
>G : Symbol(G, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 3, 17))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 13, 25))
var result2: number = foo(x => new G<typeof x>(x)); // x has type D, new G(x) fails, so first overload is picked.
>result2 : Symbol(result2, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 15, 3))
>foo : Symbol(foo, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 7, 1), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 52), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 49))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 15, 26))
>G : Symbol(G, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 3, 17))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 15, 26))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 15, 26))
var result3: string = foo(x => { // x has type D
>result3 : Symbol(result3, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 17, 3))
>foo : Symbol(foo, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 7, 1), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 9, 52), Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 10, 49))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 17, 26))
var y: G<typeof x>; // error that D does not satisfy constraint, y is of type G<D>, entire call to foo is an error
>y : Symbol(y, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 18, 7))
>G : Symbol(G, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 3, 17))
>x : Symbol(x, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 17, 26))
return y;
>y : Symbol(y, Decl(overloadresolutionWithConstraintCheckingDeferred.ts, 18, 7))
});