TypeScript/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.symbols
Wesley Wigham 5353475fce Always collect type and symbol baselines (#18621)
* Always generate type & symbol baselines

* Accept changed shadowed baselines

* Accept brand new type and symbol baselines

* Allow `getTypeAtLocation` to return undefined in the type writer

* Accept baselines which had missing type information

* Bind container for dynamically names enum members so they may be printed

* Accept type/symbol baselines for enums with computed members

* First pass at reducing typeWriter memory overhead

* Use generators to allow for type and symbol baselines with no cache

* Accept new baselines for tests whose output was fixed by better newline splitting

* Hard cap on number of declarations printed, cache declaration print text

* handle differing newlines better still to handle RWC newlines

* Lower abridging count, accept abridged baselines

* Limit max RWC error output size, limit RWC type and symbol baseline input size

* Move skip logic into type and symbol baseliner to streamline error handling

* Accept removal of empty baselines

* Canonicalize path earlier to handle odd paths in input files

* Do canonicalization earlier still, also ensure parallel perf profiles for different targets do not trample one another

* No need to pathify again
2017-09-22 15:52:04 -07:00

77 lines
5.2 KiB
Plaintext

=== 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))
});