From b746f8e8a4d4b20ba74efa17e45adcdf7e824823 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 10 Apr 2018 17:39:55 -1000 Subject: [PATCH] Accept new baselines --- .../reference/keyofAndIndexedAccess.js | 8 ++--- .../reference/keyofAndIndexedAccess.symbols | 36 ++++++++++--------- .../reference/keyofAndIndexedAccess.types | 22 ++++++------ 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js index 70f1c8b856e..422cef5a574 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.js +++ b/tests/baselines/reference/keyofAndIndexedAccess.js @@ -188,13 +188,13 @@ function f51(k: K, s: string) { const x2 = k as string; } -function f52(obj: { [x: string]: boolean }, k: keyof T, s: string, n: number) { +function f52(obj: { [x: string]: boolean }, k: Exclude, s: string, n: number) { const x1 = obj[s]; const x2 = obj[n]; const x3 = obj[k]; } -function f53(obj: { [x: string]: boolean }, k: K, s: string, n: number) { +function f53>(obj: { [x: string]: boolean }, k: K, s: string, n: number) { const x1 = obj[s]; const x2 = obj[n]; const x3 = obj[k]; @@ -1048,8 +1048,8 @@ declare function f50(k: keyof T, s: string): void; declare function f51(k: K, s: string): void; declare function f52(obj: { [x: string]: boolean; -}, k: keyof T, s: string, n: number): void; -declare function f53(obj: { +}, k: Exclude, s: string, n: number): void; +declare function f53>(obj: { [x: string]: boolean; }, k: K, s: string, n: number): void; declare function f54(obj: T, key: keyof T): void; diff --git a/tests/baselines/reference/keyofAndIndexedAccess.symbols b/tests/baselines/reference/keyofAndIndexedAccess.symbols index 1d59deb12b3..b1206a49388 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccess.symbols @@ -651,25 +651,26 @@ function f51(k: K, s: string) { >k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 184, 35)) } -function f52(obj: { [x: string]: boolean }, k: keyof T, s: string, n: number) { +function f52(obj: { [x: string]: boolean }, k: Exclude, s: string, n: number) { >f52 : Symbol(f52, Decl(keyofAndIndexedAccess.ts, 187, 1)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 189, 13)) >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 189, 16)) >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 189, 24)) >k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 189, 46)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 189, 13)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 189, 58)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 189, 69)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 189, 75)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 189, 86)) const x1 = obj[s]; >x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 190, 9)) >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 189, 16)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 189, 58)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 189, 75)) const x2 = obj[n]; >x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 191, 9)) >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 189, 16)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 189, 69)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 189, 86)) const x3 = obj[k]; >x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 192, 9)) @@ -677,32 +678,33 @@ function f52(obj: { [x: string]: boolean }, k: keyof T, s: string, n: number) >k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 189, 46)) } -function f53(obj: { [x: string]: boolean }, k: K, s: string, n: number) { +function f53>(obj: { [x: string]: boolean }, k: K, s: string, n: number) { >f53 : Symbol(f53, Decl(keyofAndIndexedAccess.ts, 193, 1)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 195, 13)) >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 195, 15)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 195, 13)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 35)) ->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 195, 43)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 195, 65)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 195, 60)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 195, 82)) >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 195, 15)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 195, 71)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 195, 82)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 195, 88)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 195, 99)) const x1 = obj[s]; >x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 196, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 35)) ->s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 195, 71)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>s : Symbol(s, Decl(keyofAndIndexedAccess.ts, 195, 88)) const x2 = obj[n]; >x2 : Symbol(x2, Decl(keyofAndIndexedAccess.ts, 197, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 35)) ->n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 195, 82)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>n : Symbol(n, Decl(keyofAndIndexedAccess.ts, 195, 99)) const x3 = obj[k]; >x3 : Symbol(x3, Decl(keyofAndIndexedAccess.ts, 198, 9)) ->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 35)) ->k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 195, 65)) +>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 195, 52)) +>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 195, 82)) } function f54(obj: T, key: keyof T) { diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 462dde9ca03..4e41b58e664 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -92,7 +92,7 @@ type K11 = keyof Shape[]; // "length" | "toString" | ... >Shape : Shape type K12 = keyof Dictionary; // string ->K12 : string | number | symbol +>K12 : string | number >Dictionary : Dictionary >Shape : Shape @@ -136,7 +136,7 @@ type K20 = KeyOf; // "name" | "width" | "height" | "visible" >Shape : Shape type K21 = KeyOf>; // string ->K21 : string | number | symbol +>K21 : string | number >KeyOf : keyof T >Dictionary : Dictionary >Shape : Shape @@ -756,12 +756,13 @@ function f51(k: K, s: string) { >k : K } -function f52(obj: { [x: string]: boolean }, k: keyof T, s: string, n: number) { ->f52 : (obj: { [x: string]: boolean; }, k: keyof T, s: string, n: number) => void +function f52(obj: { [x: string]: boolean }, k: Exclude, s: string, n: number) { +>f52 : (obj: { [x: string]: boolean; }, k: Exclude, s: string, n: number) => void >T : T >obj : { [x: string]: boolean; } >x : string ->k : keyof T +>k : Exclude +>Exclude : Exclude >T : T >s : string >n : number @@ -779,16 +780,17 @@ function f52(obj: { [x: string]: boolean }, k: keyof T, s: string, n: number) >n : number const x3 = obj[k]; ->x3 : { [x: string]: boolean; }[keyof T] ->obj[k] : { [x: string]: boolean; }[keyof T] +>x3 : { [x: string]: boolean; }[Exclude] +>obj[k] : { [x: string]: boolean; }[Exclude] >obj : { [x: string]: boolean; } ->k : keyof T +>k : Exclude } -function f53(obj: { [x: string]: boolean }, k: K, s: string, n: number) { ->f53 : (obj: { [x: string]: boolean; }, k: K, s: string, n: number) => void +function f53>(obj: { [x: string]: boolean }, k: K, s: string, n: number) { +>f53 : >(obj: { [x: string]: boolean; }, k: K, s: string, n: number) => void >T : T >K : K +>Exclude : Exclude >T : T >obj : { [x: string]: boolean; } >x : string