* 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
138 lines
6.3 KiB
Text
138 lines
6.3 KiB
Text
=== tests/cases/compiler/overload1.ts ===
|
|
module O {
|
|
>O : Symbol(O, Decl(overload1.ts, 0, 0))
|
|
|
|
export class A {
|
|
>A : Symbol(A, Decl(overload1.ts, 0, 10))
|
|
|
|
}
|
|
|
|
export class B extends A {
|
|
>B : Symbol(B, Decl(overload1.ts, 3, 5))
|
|
>A : Symbol(A, Decl(overload1.ts, 0, 10))
|
|
}
|
|
|
|
export class C extends B {
|
|
>C : Symbol(C, Decl(overload1.ts, 6, 5))
|
|
>B : Symbol(B, Decl(overload1.ts, 3, 5))
|
|
|
|
}
|
|
|
|
export interface I {
|
|
>I : Symbol(I, Decl(overload1.ts, 10, 5))
|
|
|
|
f(s:string):number;
|
|
>f : Symbol(I.f, Decl(overload1.ts, 12, 24), Decl(overload1.ts, 13, 27))
|
|
>s : Symbol(s, Decl(overload1.ts, 13, 10))
|
|
|
|
f(n:number):string;
|
|
>f : Symbol(I.f, Decl(overload1.ts, 12, 24), Decl(overload1.ts, 13, 27))
|
|
>n : Symbol(n, Decl(overload1.ts, 14, 10))
|
|
|
|
g(n1:number,n2:number):number;
|
|
>g : Symbol(I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>n1 : Symbol(n1, Decl(overload1.ts, 15, 10))
|
|
>n2 : Symbol(n2, Decl(overload1.ts, 15, 20))
|
|
|
|
g(n:number):string;
|
|
>g : Symbol(I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>n : Symbol(n, Decl(overload1.ts, 16, 10))
|
|
|
|
g(a:A):C;
|
|
>g : Symbol(I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>a : Symbol(a, Decl(overload1.ts, 17, 10))
|
|
>A : Symbol(A, Decl(overload1.ts, 0, 10))
|
|
>C : Symbol(C, Decl(overload1.ts, 6, 5))
|
|
|
|
g(c:C):string;
|
|
>g : Symbol(I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>c : Symbol(c, Decl(overload1.ts, 18, 10))
|
|
>C : Symbol(C, Decl(overload1.ts, 6, 5))
|
|
|
|
h(s1:string,s2:number):string;
|
|
>h : Symbol(I.h, Decl(overload1.ts, 18, 22), Decl(overload1.ts, 19, 38))
|
|
>s1 : Symbol(s1, Decl(overload1.ts, 19, 10))
|
|
>s2 : Symbol(s2, Decl(overload1.ts, 19, 20))
|
|
|
|
h(s1:number,s2:string):number;
|
|
>h : Symbol(I.h, Decl(overload1.ts, 18, 22), Decl(overload1.ts, 19, 38))
|
|
>s1 : Symbol(s1, Decl(overload1.ts, 20, 10))
|
|
>s2 : Symbol(s2, Decl(overload1.ts, 20, 20))
|
|
}
|
|
}
|
|
|
|
declare var x:O.I;
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>O : Symbol(O, Decl(overload1.ts, 0, 0))
|
|
>I : Symbol(O.I, Decl(overload1.ts, 10, 5))
|
|
|
|
var e:string=x.g(new O.A()); // matches overload but bad assignment
|
|
>e : Symbol(e, Decl(overload1.ts, 26, 3))
|
|
>x.g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>O.A : Symbol(O.A, Decl(overload1.ts, 0, 10))
|
|
>O : Symbol(O, Decl(overload1.ts, 0, 0))
|
|
>A : Symbol(O.A, Decl(overload1.ts, 0, 10))
|
|
|
|
var y:string=x.f(3); // good
|
|
>y : Symbol(y, Decl(overload1.ts, 27, 3))
|
|
>x.f : Symbol(O.I.f, Decl(overload1.ts, 12, 24), Decl(overload1.ts, 13, 27))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>f : Symbol(O.I.f, Decl(overload1.ts, 12, 24), Decl(overload1.ts, 13, 27))
|
|
|
|
y=x.f("nope"); // can't assign number to string
|
|
>y : Symbol(y, Decl(overload1.ts, 27, 3))
|
|
>x.f : Symbol(O.I.f, Decl(overload1.ts, 12, 24), Decl(overload1.ts, 13, 27))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>f : Symbol(O.I.f, Decl(overload1.ts, 12, 24), Decl(overload1.ts, 13, 27))
|
|
|
|
var z:string=x.g(x.g(3,3)); // good
|
|
>z : Symbol(z, Decl(overload1.ts, 29, 3))
|
|
>x.g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x.g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
|
|
z=x.g(2,2,2); // no match
|
|
>z : Symbol(z, Decl(overload1.ts, 29, 3))
|
|
>x.g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
|
|
z=x.g(); // no match
|
|
>z : Symbol(z, Decl(overload1.ts, 29, 3))
|
|
>x.g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
|
|
z=x.g(new O.B()); // ambiguous (up and down conversion)
|
|
>z : Symbol(z, Decl(overload1.ts, 29, 3))
|
|
>x.g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>O.B : Symbol(O.B, Decl(overload1.ts, 3, 5))
|
|
>O : Symbol(O, Decl(overload1.ts, 0, 0))
|
|
>B : Symbol(O.B, Decl(overload1.ts, 3, 5))
|
|
|
|
z=x.h(2,2); // no match
|
|
>z : Symbol(z, Decl(overload1.ts, 29, 3))
|
|
>x.h : Symbol(O.I.h, Decl(overload1.ts, 18, 22), Decl(overload1.ts, 19, 38))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>h : Symbol(O.I.h, Decl(overload1.ts, 18, 22), Decl(overload1.ts, 19, 38))
|
|
|
|
z=x.h("hello",0); // good
|
|
>z : Symbol(z, Decl(overload1.ts, 29, 3))
|
|
>x.h : Symbol(O.I.h, Decl(overload1.ts, 18, 22), Decl(overload1.ts, 19, 38))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>h : Symbol(O.I.h, Decl(overload1.ts, 18, 22), Decl(overload1.ts, 19, 38))
|
|
|
|
var v=x.g;
|
|
>v : Symbol(v, Decl(overload1.ts, 36, 3))
|
|
>x.g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
>x : Symbol(x, Decl(overload1.ts, 24, 11))
|
|
>g : Symbol(O.I.g, Decl(overload1.ts, 14, 27), Decl(overload1.ts, 15, 38), Decl(overload1.ts, 16, 27), Decl(overload1.ts, 17, 17))
|
|
|
|
|