Update baselines from merge master
This commit is contained in:
parent
b9bd6b9539
commit
1266b0d1d4
1 changed files with 91 additions and 91 deletions
|
@ -3,52 +3,52 @@
|
||||||
// is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T
|
// is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T
|
||||||
|
|
||||||
enum E { red, blue }
|
enum E { red, blue }
|
||||||
>E : E, Symbol(E, Decl(functionExpressionContextualTyping1.ts, 0, 0))
|
>E : E
|
||||||
>red : E, Symbol(E.red, Decl(functionExpressionContextualTyping1.ts, 3, 8))
|
>red : E
|
||||||
>blue : E, Symbol(E.blue, Decl(functionExpressionContextualTyping1.ts, 3, 13))
|
>blue : E
|
||||||
|
|
||||||
// A contextual signature S is extracted from a function type T as follows:
|
// A contextual signature S is extracted from a function type T as follows:
|
||||||
// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature.
|
// If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature.
|
||||||
|
|
||||||
var a0: (n: number, s: string) => number = (num, str) => {
|
var a0: (n: number, s: string) => number = (num, str) => {
|
||||||
>a0 : (n: number, s: string) => number, Symbol(a0, Decl(functionExpressionContextualTyping1.ts, 8, 3))
|
>a0 : (n: number, s: string) => number
|
||||||
>n : number, Symbol(n, Decl(functionExpressionContextualTyping1.ts, 8, 9))
|
>n : number
|
||||||
>s : string, Symbol(s, Decl(functionExpressionContextualTyping1.ts, 8, 19))
|
>s : string
|
||||||
>(num, str) => { num.toExponential(); return 0;} : (num: number, str: string) => number
|
>(num, str) => { num.toExponential(); return 0;} : (num: number, str: string) => number
|
||||||
>num : number, Symbol(num, Decl(functionExpressionContextualTyping1.ts, 8, 44))
|
>num : number
|
||||||
>str : string, Symbol(str, Decl(functionExpressionContextualTyping1.ts, 8, 48))
|
>str : string
|
||||||
|
|
||||||
num.toExponential();
|
num.toExponential();
|
||||||
>num.toExponential() : string
|
>num.toExponential() : string
|
||||||
>num.toExponential : (fractionDigits?: number) => string, Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45))
|
>num.toExponential : (fractionDigits?: number) => string
|
||||||
>num : number, Symbol(num, Decl(functionExpressionContextualTyping1.ts, 8, 44))
|
>num : number
|
||||||
>toExponential : (fractionDigits?: number) => string, Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45))
|
>toExponential : (fractionDigits?: number) => string
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
>0 : number
|
>0 : number
|
||||||
}
|
}
|
||||||
|
|
||||||
class Class<T> {
|
class Class<T> {
|
||||||
>Class : Class<T>, Symbol(Class, Decl(functionExpressionContextualTyping1.ts, 11, 1))
|
>Class : Class<T>
|
||||||
>T : T, Symbol(T, Decl(functionExpressionContextualTyping1.ts, 13, 12))
|
>T : T
|
||||||
|
|
||||||
foo() { }
|
foo() { }
|
||||||
>foo : () => void, Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 13, 16))
|
>foo : () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
var a1: (c: Class<Number>) => number = (a1) => {
|
var a1: (c: Class<Number>) => number = (a1) => {
|
||||||
>a1 : (c: Class<Number>) => number, Symbol(a1, Decl(functionExpressionContextualTyping1.ts, 17, 3))
|
>a1 : (c: Class<Number>) => number
|
||||||
>c : Class<Number>, Symbol(c, Decl(functionExpressionContextualTyping1.ts, 17, 9))
|
>c : Class<Number>
|
||||||
>Class : Class<T>, Symbol(Class, Decl(functionExpressionContextualTyping1.ts, 11, 1))
|
>Class : Class<T>
|
||||||
>Number : Number, Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
>Number : Number
|
||||||
>(a1) => { a1.foo(); return 1;} : (a1: Class<Number>) => number
|
>(a1) => { a1.foo(); return 1;} : (a1: Class<Number>) => number
|
||||||
>a1 : Class<Number>, Symbol(a1, Decl(functionExpressionContextualTyping1.ts, 17, 40))
|
>a1 : Class<Number>
|
||||||
|
|
||||||
a1.foo();
|
a1.foo();
|
||||||
>a1.foo() : void
|
>a1.foo() : void
|
||||||
>a1.foo : () => void, Symbol(Class.foo, Decl(functionExpressionContextualTyping1.ts, 13, 16))
|
>a1.foo : () => void
|
||||||
>a1 : Class<Number>, Symbol(a1, Decl(functionExpressionContextualTyping1.ts, 17, 40))
|
>a1 : Class<Number>
|
||||||
>foo : () => void, Symbol(Class.foo, Decl(functionExpressionContextualTyping1.ts, 13, 16))
|
>foo : () => void
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
>1 : number
|
>1 : number
|
||||||
|
@ -60,146 +60,146 @@ var a1: (c: Class<Number>) => number = (a1) => {
|
||||||
// and if all of the signatures are identical ignoring return types,
|
// and if all of the signatures are identical ignoring return types,
|
||||||
// then S is a signature with the same parameters and a union of the return types.
|
// then S is a signature with the same parameters and a union of the return types.
|
||||||
var b1: ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string);
|
var b1: ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string);
|
||||||
>b1 : ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string), Symbol(b1, Decl(functionExpressionContextualTyping1.ts, 27, 3))
|
>b1 : ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string)
|
||||||
>s : string, Symbol(s, Decl(functionExpressionContextualTyping1.ts, 27, 10))
|
>s : string
|
||||||
>w : boolean, Symbol(w, Decl(functionExpressionContextualTyping1.ts, 27, 20))
|
>w : boolean
|
||||||
>s : string, Symbol(s, Decl(functionExpressionContextualTyping1.ts, 27, 46))
|
>s : string
|
||||||
>w : boolean, Symbol(w, Decl(functionExpressionContextualTyping1.ts, 27, 56))
|
>w : boolean
|
||||||
|
|
||||||
b1 = (k, h) => { };
|
b1 = (k, h) => { };
|
||||||
>b1 = (k, h) => { } : (k: string, h: boolean) => void
|
>b1 = (k, h) => { } : (k: string, h: boolean) => void
|
||||||
>b1 : ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string), Symbol(b1, Decl(functionExpressionContextualTyping1.ts, 27, 3))
|
>b1 : ((s: string, w: boolean) => void) | ((s: string, w: boolean) => string)
|
||||||
>(k, h) => { } : (k: string, h: boolean) => void
|
>(k, h) => { } : (k: string, h: boolean) => void
|
||||||
>k : string, Symbol(k, Decl(functionExpressionContextualTyping1.ts, 28, 6))
|
>k : string
|
||||||
>h : boolean, Symbol(h, Decl(functionExpressionContextualTyping1.ts, 28, 8))
|
>h : boolean
|
||||||
|
|
||||||
var b2: typeof a0 | ((n: number, s: string) => string);
|
var b2: typeof a0 | ((n: number, s: string) => string);
|
||||||
>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string), Symbol(b2, Decl(functionExpressionContextualTyping1.ts, 29, 3))
|
>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string)
|
||||||
>a0 : (n: number, s: string) => number, Symbol(a0, Decl(functionExpressionContextualTyping1.ts, 8, 3))
|
>a0 : (n: number, s: string) => number
|
||||||
>n : number, Symbol(n, Decl(functionExpressionContextualTyping1.ts, 29, 22))
|
>n : number
|
||||||
>s : string, Symbol(s, Decl(functionExpressionContextualTyping1.ts, 29, 32))
|
>s : string
|
||||||
|
|
||||||
b2 = (foo, bar) => { return foo + 1; }
|
b2 = (foo, bar) => { return foo + 1; }
|
||||||
>b2 = (foo, bar) => { return foo + 1; } : (foo: number, bar: string) => number
|
>b2 = (foo, bar) => { return foo + 1; } : (foo: number, bar: string) => number
|
||||||
>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string), Symbol(b2, Decl(functionExpressionContextualTyping1.ts, 29, 3))
|
>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string)
|
||||||
>(foo, bar) => { return foo + 1; } : (foo: number, bar: string) => number
|
>(foo, bar) => { return foo + 1; } : (foo: number, bar: string) => number
|
||||||
>foo : number, Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 30, 6))
|
>foo : number
|
||||||
>bar : string, Symbol(bar, Decl(functionExpressionContextualTyping1.ts, 30, 10))
|
>bar : string
|
||||||
>foo + 1 : number
|
>foo + 1 : number
|
||||||
>foo : number, Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 30, 6))
|
>foo : number
|
||||||
>1 : number
|
>1 : number
|
||||||
|
|
||||||
b2 = (foo, bar) => { return "hello"; }
|
b2 = (foo, bar) => { return "hello"; }
|
||||||
>b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => string
|
>b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => string
|
||||||
>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string), Symbol(b2, Decl(functionExpressionContextualTyping1.ts, 29, 3))
|
>b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string)
|
||||||
>(foo, bar) => { return "hello"; } : (foo: number, bar: string) => string
|
>(foo, bar) => { return "hello"; } : (foo: number, bar: string) => string
|
||||||
>foo : number, Symbol(foo, Decl(functionExpressionContextualTyping1.ts, 31, 6))
|
>foo : number
|
||||||
>bar : string, Symbol(bar, Decl(functionExpressionContextualTyping1.ts, 31, 10))
|
>bar : string
|
||||||
>"hello" : string
|
>"hello" : string
|
||||||
|
|
||||||
var b3: (name: string, num: number, boo: boolean) => void;
|
var b3: (name: string, num: number, boo: boolean) => void;
|
||||||
>b3 : (name: string, num: number, boo: boolean) => void, Symbol(b3, Decl(functionExpressionContextualTyping1.ts, 32, 3))
|
>b3 : (name: string, num: number, boo: boolean) => void
|
||||||
>name : string, Symbol(name, Decl(functionExpressionContextualTyping1.ts, 32, 9))
|
>name : string
|
||||||
>num : number, Symbol(num, Decl(functionExpressionContextualTyping1.ts, 32, 22))
|
>num : number
|
||||||
>boo : boolean, Symbol(boo, Decl(functionExpressionContextualTyping1.ts, 32, 35))
|
>boo : boolean
|
||||||
|
|
||||||
b3 = (name, number) => { };
|
b3 = (name, number) => { };
|
||||||
>b3 = (name, number) => { } : (name: string, number: number) => void
|
>b3 = (name, number) => { } : (name: string, number: number) => void
|
||||||
>b3 : (name: string, num: number, boo: boolean) => void, Symbol(b3, Decl(functionExpressionContextualTyping1.ts, 32, 3))
|
>b3 : (name: string, num: number, boo: boolean) => void
|
||||||
>(name, number) => { } : (name: string, number: number) => void
|
>(name, number) => { } : (name: string, number: number) => void
|
||||||
>name : string, Symbol(name, Decl(functionExpressionContextualTyping1.ts, 33, 6))
|
>name : string
|
||||||
>number : number, Symbol(number, Decl(functionExpressionContextualTyping1.ts, 33, 11))
|
>number : number
|
||||||
|
|
||||||
var b4: (n: E) => string = (number = 1) => { return "hello"; };
|
var b4: (n: E) => string = (number = 1) => { return "hello"; };
|
||||||
>b4 : (n: E) => string, Symbol(b4, Decl(functionExpressionContextualTyping1.ts, 35, 3))
|
>b4 : (n: E) => string
|
||||||
>n : E, Symbol(n, Decl(functionExpressionContextualTyping1.ts, 35, 9))
|
>n : E
|
||||||
>E : E, Symbol(E, Decl(functionExpressionContextualTyping1.ts, 0, 0))
|
>E : E
|
||||||
>(number = 1) => { return "hello"; } : (number?: E) => string
|
>(number = 1) => { return "hello"; } : (number?: E) => string
|
||||||
>number : E, Symbol(number, Decl(functionExpressionContextualTyping1.ts, 35, 28))
|
>number : E
|
||||||
>1 : number
|
>1 : number
|
||||||
>"hello" : string
|
>"hello" : string
|
||||||
|
|
||||||
var b5: (n: {}) => string = (number = "string") => { return "hello"; };
|
var b5: (n: {}) => string = (number = "string") => { return "hello"; };
|
||||||
>b5 : (n: {}) => string, Symbol(b5, Decl(functionExpressionContextualTyping1.ts, 36, 3))
|
>b5 : (n: {}) => string
|
||||||
>n : {}, Symbol(n, Decl(functionExpressionContextualTyping1.ts, 36, 9))
|
>n : {}
|
||||||
>(number = "string") => { return "hello"; } : (number?: {}) => string
|
>(number = "string") => { return "hello"; } : (number?: {}) => string
|
||||||
>number : {}, Symbol(number, Decl(functionExpressionContextualTyping1.ts, 36, 29))
|
>number : {}
|
||||||
>"string" : string
|
>"string" : string
|
||||||
>"hello" : string
|
>"hello" : string
|
||||||
|
|
||||||
// A contextual signature S is extracted from a function type T as follows:
|
// A contextual signature S is extracted from a function type T as follows:
|
||||||
// Otherwise, no contextual signature can be extracted from T and S is undefined.
|
// Otherwise, no contextual signature can be extracted from T and S is undefined.
|
||||||
var b6: ((s: string, w: boolean) => void) | ((n: number) => number);
|
var b6: ((s: string, w: boolean) => void) | ((n: number) => number);
|
||||||
>b6 : ((s: string, w: boolean) => void) | ((n: number) => number), Symbol(b6, Decl(functionExpressionContextualTyping1.ts, 40, 3))
|
>b6 : ((s: string, w: boolean) => void) | ((n: number) => number)
|
||||||
>s : string, Symbol(s, Decl(functionExpressionContextualTyping1.ts, 40, 10))
|
>s : string
|
||||||
>w : boolean, Symbol(w, Decl(functionExpressionContextualTyping1.ts, 40, 20))
|
>w : boolean
|
||||||
>n : number, Symbol(n, Decl(functionExpressionContextualTyping1.ts, 40, 46))
|
>n : number
|
||||||
|
|
||||||
var b7: ((s: string, w: boolean) => void) | ((s: string, w: number) => string);
|
var b7: ((s: string, w: boolean) => void) | ((s: string, w: number) => string);
|
||||||
>b7 : ((s: string, w: boolean) => void) | ((s: string, w: number) => string), Symbol(b7, Decl(functionExpressionContextualTyping1.ts, 41, 3))
|
>b7 : ((s: string, w: boolean) => void) | ((s: string, w: number) => string)
|
||||||
>s : string, Symbol(s, Decl(functionExpressionContextualTyping1.ts, 41, 10))
|
>s : string
|
||||||
>w : boolean, Symbol(w, Decl(functionExpressionContextualTyping1.ts, 41, 20))
|
>w : boolean
|
||||||
>s : string, Symbol(s, Decl(functionExpressionContextualTyping1.ts, 41, 46))
|
>s : string
|
||||||
>w : number, Symbol(w, Decl(functionExpressionContextualTyping1.ts, 41, 56))
|
>w : number
|
||||||
|
|
||||||
b6 = (k) => { k.toLowerCase() };
|
b6 = (k) => { k.toLowerCase() };
|
||||||
>b6 = (k) => { k.toLowerCase() } : (k: any) => void
|
>b6 = (k) => { k.toLowerCase() } : (k: any) => void
|
||||||
>b6 : ((s: string, w: boolean) => void) | ((n: number) => number), Symbol(b6, Decl(functionExpressionContextualTyping1.ts, 40, 3))
|
>b6 : ((s: string, w: boolean) => void) | ((n: number) => number)
|
||||||
>(k) => { k.toLowerCase() } : (k: any) => void
|
>(k) => { k.toLowerCase() } : (k: any) => void
|
||||||
>k : any, Symbol(k, Decl(functionExpressionContextualTyping1.ts, 42, 6))
|
>k : any
|
||||||
>k.toLowerCase() : any
|
>k.toLowerCase() : any
|
||||||
>k.toLowerCase : any
|
>k.toLowerCase : any
|
||||||
>k : any, Symbol(k, Decl(functionExpressionContextualTyping1.ts, 42, 6))
|
>k : any
|
||||||
>toLowerCase : any
|
>toLowerCase : any
|
||||||
|
|
||||||
b6 = (i) => {
|
b6 = (i) => {
|
||||||
>b6 = (i) => { i.toExponential(); return i;} : (i: any) => any
|
>b6 = (i) => { i.toExponential(); return i;} : (i: any) => any
|
||||||
>b6 : ((s: string, w: boolean) => void) | ((n: number) => number), Symbol(b6, Decl(functionExpressionContextualTyping1.ts, 40, 3))
|
>b6 : ((s: string, w: boolean) => void) | ((n: number) => number)
|
||||||
>(i) => { i.toExponential(); return i;} : (i: any) => any
|
>(i) => { i.toExponential(); return i;} : (i: any) => any
|
||||||
>i : any, Symbol(i, Decl(functionExpressionContextualTyping1.ts, 43, 6))
|
>i : any
|
||||||
|
|
||||||
i.toExponential();
|
i.toExponential();
|
||||||
>i.toExponential() : any
|
>i.toExponential() : any
|
||||||
>i.toExponential : any
|
>i.toExponential : any
|
||||||
>i : any, Symbol(i, Decl(functionExpressionContextualTyping1.ts, 43, 6))
|
>i : any
|
||||||
>toExponential : any
|
>toExponential : any
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
>i : any, Symbol(i, Decl(functionExpressionContextualTyping1.ts, 43, 6))
|
>i : any
|
||||||
|
|
||||||
}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause)
|
}; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause)
|
||||||
b7 = (j, m) => { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause)
|
b7 = (j, m) => { }; // Per spec, no contextual signature can be extracted in this case. (Otherwise clause)
|
||||||
>b7 = (j, m) => { } : (j: any, m: any) => void
|
>b7 = (j, m) => { } : (j: any, m: any) => void
|
||||||
>b7 : ((s: string, w: boolean) => void) | ((s: string, w: number) => string), Symbol(b7, Decl(functionExpressionContextualTyping1.ts, 41, 3))
|
>b7 : ((s: string, w: boolean) => void) | ((s: string, w: number) => string)
|
||||||
>(j, m) => { } : (j: any, m: any) => void
|
>(j, m) => { } : (j: any, m: any) => void
|
||||||
>j : any, Symbol(j, Decl(functionExpressionContextualTyping1.ts, 47, 6))
|
>j : any
|
||||||
>m : any, Symbol(m, Decl(functionExpressionContextualTyping1.ts, 47, 8))
|
>m : any
|
||||||
|
|
||||||
class C<T, U> {
|
class C<T, U> {
|
||||||
>C : C<T, U>, Symbol(C, Decl(functionExpressionContextualTyping1.ts, 47, 19))
|
>C : C<T, U>
|
||||||
>T : T, Symbol(T, Decl(functionExpressionContextualTyping1.ts, 49, 8))
|
>T : T
|
||||||
>U : U, Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10))
|
>U : U
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
var k: ((j: T, k: U) => (T|U)[]) | ((j: number,k :U) => number[]) = (j, k) => {
|
var k: ((j: T, k: U) => (T|U)[]) | ((j: number,k :U) => number[]) = (j, k) => {
|
||||||
>k : ((j: T, k: U) => (T | U)[]) | ((j: number, k: U) => number[]), Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 11))
|
>k : ((j: T, k: U) => (T | U)[]) | ((j: number, k: U) => number[])
|
||||||
>j : T, Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 17))
|
>j : T
|
||||||
>T : T, Symbol(T, Decl(functionExpressionContextualTyping1.ts, 49, 8))
|
>T : T
|
||||||
>k : U, Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 22))
|
>k : U
|
||||||
>U : U, Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10))
|
>U : U
|
||||||
>T : T, Symbol(T, Decl(functionExpressionContextualTyping1.ts, 49, 8))
|
>T : T
|
||||||
>U : U, Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10))
|
>U : U
|
||||||
>j : number, Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 45))
|
>j : number
|
||||||
>k : U, Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 55))
|
>k : U
|
||||||
>U : U, Symbol(U, Decl(functionExpressionContextualTyping1.ts, 49, 10))
|
>U : U
|
||||||
>(j, k) => { return [j, k]; } : (j: any, k: any) => any[]
|
>(j, k) => { return [j, k]; } : (j: any, k: any) => any[]
|
||||||
>j : any, Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 77))
|
>j : any
|
||||||
>k : any, Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 79))
|
>k : any
|
||||||
|
|
||||||
return [j, k];
|
return [j, k];
|
||||||
>[j, k] : any[]
|
>[j, k] : any[]
|
||||||
>j : any, Symbol(j, Decl(functionExpressionContextualTyping1.ts, 51, 77))
|
>j : any
|
||||||
>k : any, Symbol(k, Decl(functionExpressionContextualTyping1.ts, 51, 79))
|
>k : any
|
||||||
|
|
||||||
} // Per spec, no contextual signature can be extracted in this case.
|
} // Per spec, no contextual signature can be extracted in this case.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue