* 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
222 lines
4.3 KiB
Plaintext
222 lines
4.3 KiB
Plaintext
=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers.ts ===
|
|
// Optional parameters allow initializers only in implementation signatures
|
|
|
|
function foo(x = 1) { }
|
|
>foo : (x?: number) => void
|
|
>x : number
|
|
>1 : 1
|
|
|
|
var f = function foo(x = 1) { }
|
|
>f : (x?: number) => void
|
|
>function foo(x = 1) { } : (x?: number) => void
|
|
>foo : (x?: number) => void
|
|
>x : number
|
|
>1 : 1
|
|
|
|
var f2 = (x: number, y = 1) => { }
|
|
>f2 : (x: number, y?: number) => void
|
|
>(x: number, y = 1) => { } : (x: number, y?: number) => void
|
|
>x : number
|
|
>y : number
|
|
>1 : 1
|
|
|
|
foo(1);
|
|
>foo(1) : void
|
|
>foo : (x?: number) => void
|
|
>1 : 1
|
|
|
|
foo();
|
|
>foo() : void
|
|
>foo : (x?: number) => void
|
|
|
|
f(1);
|
|
>f(1) : void
|
|
>f : (x?: number) => void
|
|
>1 : 1
|
|
|
|
f();
|
|
>f() : void
|
|
>f : (x?: number) => void
|
|
|
|
f2(1);
|
|
>f2(1) : void
|
|
>f2 : (x: number, y?: number) => void
|
|
>1 : 1
|
|
|
|
f2(1, 2);
|
|
>f2(1, 2) : void
|
|
>f2 : (x: number, y?: number) => void
|
|
>1 : 1
|
|
>2 : 2
|
|
|
|
class C {
|
|
>C : C
|
|
|
|
foo(x = 1) { }
|
|
>foo : (x?: number) => void
|
|
>x : number
|
|
>1 : 1
|
|
}
|
|
|
|
var c: C;
|
|
>c : C
|
|
>C : C
|
|
|
|
c.foo();
|
|
>c.foo() : void
|
|
>c.foo : (x?: number) => void
|
|
>c : C
|
|
>foo : (x?: number) => void
|
|
|
|
c.foo(1);
|
|
>c.foo(1) : void
|
|
>c.foo : (x?: number) => void
|
|
>c : C
|
|
>foo : (x?: number) => void
|
|
>1 : 1
|
|
|
|
// these are errors
|
|
interface I {
|
|
>I : I
|
|
|
|
(x = 1);
|
|
>x : number
|
|
>1 : 1
|
|
|
|
foo(x: number, y = 1);
|
|
>foo : (x: number, y?: number) => any
|
|
>x : number
|
|
>y : number
|
|
>1 : 1
|
|
}
|
|
|
|
var i: I;
|
|
>i : I
|
|
>I : I
|
|
|
|
i();
|
|
>i() : any
|
|
>i : I
|
|
|
|
i(1);
|
|
>i(1) : any
|
|
>i : I
|
|
>1 : 1
|
|
|
|
i.foo(1);
|
|
>i.foo(1) : any
|
|
>i.foo : (x: number, y?: number) => any
|
|
>i : I
|
|
>foo : (x: number, y?: number) => any
|
|
>1 : 1
|
|
|
|
i.foo(1, 2);
|
|
>i.foo(1, 2) : any
|
|
>i.foo : (x: number, y?: number) => any
|
|
>i : I
|
|
>foo : (x: number, y?: number) => any
|
|
>1 : 1
|
|
>2 : 2
|
|
|
|
// these are errors
|
|
var a: {
|
|
>a : { (x?: number): any; foo(x?: number): any; }
|
|
|
|
(x = 1);
|
|
>x : number
|
|
>1 : 1
|
|
|
|
foo(x = 1);
|
|
>foo : (x?: number) => any
|
|
>x : number
|
|
>1 : 1
|
|
}
|
|
|
|
a();
|
|
>a() : any
|
|
>a : { (x?: number): any; foo(x?: number): any; }
|
|
|
|
a(1);
|
|
>a(1) : any
|
|
>a : { (x?: number): any; foo(x?: number): any; }
|
|
>1 : 1
|
|
|
|
a.foo();
|
|
>a.foo() : any
|
|
>a.foo : (x?: number) => any
|
|
>a : { (x?: number): any; foo(x?: number): any; }
|
|
>foo : (x?: number) => any
|
|
|
|
a.foo(1);
|
|
>a.foo(1) : any
|
|
>a.foo : (x?: number) => any
|
|
>a : { (x?: number): any; foo(x?: number): any; }
|
|
>foo : (x?: number) => any
|
|
>1 : 1
|
|
|
|
var b = {
|
|
>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
>{ foo(x = 1) { }, a: function foo(x: number, y = 1) { }, b: (x = 1) => { }} : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
|
|
foo(x = 1) { },
|
|
>foo : (x?: number) => void
|
|
>x : number
|
|
>1 : 1
|
|
|
|
a: function foo(x: number, y = 1) { },
|
|
>a : (x: number, y?: number) => void
|
|
>function foo(x: number, y = 1) { } : (x: number, y?: number) => void
|
|
>foo : (x: number, y?: number) => void
|
|
>x : number
|
|
>y : number
|
|
>1 : 1
|
|
|
|
b: (x = 1) => { }
|
|
>b : (x?: number) => void
|
|
>(x = 1) => { } : (x?: number) => void
|
|
>x : number
|
|
>1 : 1
|
|
}
|
|
|
|
b.foo();
|
|
>b.foo() : void
|
|
>b.foo : (x?: number) => void
|
|
>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
>foo : (x?: number) => void
|
|
|
|
b.foo(1);
|
|
>b.foo(1) : void
|
|
>b.foo : (x?: number) => void
|
|
>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
>foo : (x?: number) => void
|
|
>1 : 1
|
|
|
|
b.a(1);
|
|
>b.a(1) : void
|
|
>b.a : (x: number, y?: number) => void
|
|
>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
>a : (x: number, y?: number) => void
|
|
>1 : 1
|
|
|
|
b.a(1, 2);
|
|
>b.a(1, 2) : void
|
|
>b.a : (x: number, y?: number) => void
|
|
>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
>a : (x: number, y?: number) => void
|
|
>1 : 1
|
|
>2 : 2
|
|
|
|
b.b();
|
|
>b.b() : void
|
|
>b.b : (x?: number) => void
|
|
>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
>b : (x?: number) => void
|
|
|
|
b.b(1);
|
|
>b.b(1) : void
|
|
>b.b : (x?: number) => void
|
|
>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; }
|
|
>b : (x?: number) => void
|
|
>1 : 1
|
|
|