From a2a48964f55cb7f6c47a3f0b347cdbb5ceae1a25 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 28 Jun 2016 17:07:42 -0700 Subject: [PATCH] Accept new baselines --- .../logicalOrOperatorWithEveryType.types | 2 +- tests/baselines/reference/neverType.types | 2 +- .../stringLiteralCheckedInIf01.types | 10 ++++---- .../stringLiteralCheckedInIf02.types | 2 +- .../stringLiteralMatchedInSwitch01.types | 2 +- .../stringLiteralTypesAndTuples01.types | 4 ++-- .../stringLiteralTypesInUnionTypes01.types | 24 +++++++++---------- .../stringLiteralTypesInUnionTypes03.types | 24 +++++++++---------- .../stringLiteralTypesInUnionTypes04.types | 20 ++++++++-------- .../stringLiteralTypesOverloads01.types | 4 ++-- 10 files changed, 47 insertions(+), 47 deletions(-) diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types b/tests/baselines/reference/logicalOrOperatorWithEveryType.types index 91485cad78d..4540e35aaf4 100644 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.types @@ -370,7 +370,7 @@ var rg6 = a6 || a6; // enum || enum is E >rg6 : E >a6 || a6 : E >a6 : E ->a6 : never +>a6 : E var rg7 = a7 || a6; // object || enum is object | enum >rg7 : { a: string; } | E diff --git a/tests/baselines/reference/neverType.types b/tests/baselines/reference/neverType.types index 5cd6f419a9d..72d8eae6b3b 100644 --- a/tests/baselines/reference/neverType.types +++ b/tests/baselines/reference/neverType.types @@ -102,7 +102,7 @@ function move2(direction: "up" | "down") { direction === "down" ? -1 : >direction === "down" ? -1 : error("Should never get here") : number >direction === "down" : boolean ->direction : "up" | "down" +>direction : "down" >"down" : "down" >-1 : number >1 : number diff --git a/tests/baselines/reference/stringLiteralCheckedInIf01.types b/tests/baselines/reference/stringLiteralCheckedInIf01.types index be25df63f20..23db9900231 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf01.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf01.types @@ -9,7 +9,7 @@ type T = S[] | S; >S : "a" | "b" function f(foo: T) { ->f : (foo: ("a" | "b")[] | "a" | "b") => ("a" | "b")[] | "a" | "b" +>f : (foo: ("a" | "b")[] | "a" | "b") => "a" | "b" >foo : ("a" | "b")[] | "a" | "b" >T : ("a" | "b")[] | "a" | "b" @@ -19,22 +19,22 @@ function f(foo: T) { >"a" : "a" return foo; ->foo : ("a" | "b")[] | "a" | "b" +>foo : "a" } else if (foo === "b") { >foo === "b" : boolean ->foo : ("a" | "b")[] | "a" | "b" +>foo : ("a" | "b")[] | "b" >"b" : "b" return foo; ->foo : ("a" | "b")[] | "a" | "b" +>foo : "b" } else { return (foo as S[])[0]; >(foo as S[])[0] : "a" | "b" >(foo as S[]) : ("a" | "b")[] >foo as S[] : ("a" | "b")[] ->foo : ("a" | "b")[] | "a" | "b" +>foo : ("a" | "b")[] >S : "a" | "b" >0 : number } diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.types b/tests/baselines/reference/stringLiteralCheckedInIf02.types index ae0e370e33b..b287400b21d 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf02.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.types @@ -21,7 +21,7 @@ function isS(t: T): t is S { >t : ("a" | "b")[] | "a" | "b" >"a" : "a" >t === "b" : boolean ->t : ("a" | "b")[] | "a" | "b" +>t : ("a" | "b")[] | "b" >"b" : "b" } diff --git a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types index ded50d120fd..21b7029eea6 100644 --- a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types +++ b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types @@ -29,7 +29,7 @@ switch (foo) { >(foo as S[])[0] : "a" | "b" >(foo as S[]) : ("a" | "b")[] >foo as S[] : ("a" | "b")[] ->foo : ("a" | "b")[] | "a" | "b" +>foo : ("a" | "b")[] >S : "a" | "b" >0 : number diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.types b/tests/baselines/reference/stringLiteralTypesAndTuples01.types index b15656835b2..59057b85f54 100644 --- a/tests/baselines/reference/stringLiteralTypesAndTuples01.types +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.types @@ -45,7 +45,7 @@ function rawr(dino: RexOrRaptor) { } if (dino === "raptor") { >dino === "raptor" : boolean ->dino : "t-rex" | "raptor" +>dino : "raptor" >"raptor" : "raptor" return "yip yip!"; @@ -55,5 +55,5 @@ function rawr(dino: RexOrRaptor) { throw "Unexpected " + dino; >"Unexpected " + dino : string >"Unexpected " : string ->dino : "t-rex" | "raptor" +>dino : "t-rex" } diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types index aac177224b1..2d997c93ccb 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types @@ -18,35 +18,35 @@ if (x === "foo") { >"foo" : "foo" let a = x; ->a : "foo" | "bar" | "baz" ->x : "foo" | "bar" | "baz" +>a : "foo" +>x : "foo" } else if (x !== "bar") { >x !== "bar" : boolean ->x : "foo" | "bar" | "baz" +>x : "bar" | "baz" >"bar" : "bar" let b = x || y; ->b : "foo" | "bar" | "baz" ->x || y : "foo" | "bar" | "baz" ->x : "foo" | "bar" | "baz" +>b : "baz" | "foo" | "bar" +>x || y : "baz" | "foo" | "bar" +>x : "baz" >y : "foo" | "bar" | "baz" } else { let c = x; ->c : "foo" | "bar" | "baz" ->x : "foo" | "bar" | "baz" +>c : "bar" +>x : "bar" let d = y; >d : "foo" | "bar" | "baz" >y : "foo" | "bar" | "baz" let e: (typeof x) | (typeof y) = c || d; ->e : "foo" | "bar" | "baz" ->x : "foo" | "bar" | "baz" +>e : "bar" | "foo" | "baz" +>x : "bar" >y : "foo" | "bar" | "baz" ->c || d : "foo" | "bar" | "baz" ->c : "foo" | "bar" | "baz" +>c || d : "bar" | "foo" | "baz" +>c : "bar" >d : "foo" | "bar" | "baz" } diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types index c877bfffe3c..73560ac1774 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types @@ -17,35 +17,35 @@ if (x === "foo") { >"foo" : "foo" let a = x; ->a : "foo" | "bar" | number ->x : "foo" | "bar" | number +>a : "foo" +>x : "foo" } else if (x !== "bar") { >x !== "bar" : boolean ->x : "foo" | "bar" | number +>x : "bar" | number >"bar" : "bar" let b = x || y; ->b : "foo" | "bar" | number ->x || y : "foo" | "bar" | number ->x : "foo" | "bar" | number +>b : number | "foo" | "bar" +>x || y : number | "foo" | "bar" +>x : number >y : number | "foo" | "bar" } else { let c = x; ->c : "foo" | "bar" | number ->x : "foo" | "bar" | number +>c : "bar" +>x : "bar" let d = y; >d : number | "foo" | "bar" >y : number | "foo" | "bar" let e: (typeof x) | (typeof y) = c || d; ->e : "foo" | "bar" | number ->x : "foo" | "bar" | number +>e : "bar" | number | "foo" +>x : "bar" >y : number | "foo" | "bar" ->c || d : "foo" | "bar" | number ->c : "foo" | "bar" | number +>c || d : "bar" | number | "foo" +>c : "bar" >d : number | "foo" | "bar" } diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types index 81e87b727a8..9eb32b584f3 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types @@ -19,8 +19,8 @@ if (x === "") { >"" : "" let a = x; ->a : "" | "foo" ->x : "" | "foo" +>a : "" +>x : "" } if (x !== "") { @@ -29,18 +29,18 @@ if (x !== "") { >"" : "" let b = x; ->b : "" | "foo" ->x : "" | "foo" +>b : "foo" +>x : "foo" } if (x == "") { >x == "" : boolean ->x : "" | "foo" +>x : "foo" | "" >"" : "" let c = x; ->c : "" | "foo" ->x : "" | "foo" +>c : "" +>x : "" } if (x != "") { @@ -49,12 +49,12 @@ if (x != "") { >"" : "" let d = x; ->d : "" | "foo" ->x : "" | "foo" +>d : "foo" +>x : "foo" } if (x) { ->x : "" | "foo" +>x : "foo" | "" let e = x; >e : "foo" diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.types b/tests/baselines/reference/stringLiteralTypesOverloads01.types index 21c9831e9e7..71a73222ba6 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.types @@ -46,7 +46,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { } if (x === "number") { >x === "number" : boolean ->x : "string" | "number" | "boolean" +>x : "number" | "boolean" >"number" : "number" return 0; @@ -54,7 +54,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { } if (x === "boolean") { >x === "boolean" : boolean ->x : "string" | "number" | "boolean" +>x : "boolean" >"boolean" : "boolean" return false;