Accept new baselines

This commit is contained in:
Anders Hejlsberg
2018-05-21 16:43:46 -07:00
parent 8528dbee76
commit 5bbadb66ab
15 changed files with 24 additions and 24 deletions
@@ -30,7 +30,7 @@ var derived2: Derived2;
var r2 = true ? 1 : '';
>r2 : string | number
>true ? 1 : '' : 1 | ""
>true ? 1 : '' : "" | 1
>true : true
>1 : 1
>'' : ""
@@ -15,7 +15,7 @@ var i: I<string>;
>I : I<T>
var y = i(""); // y should be string
>y : string
>y : ""
>i("") : ""
>i : I<string>
>"" : ""
@@ -1,8 +1,8 @@
=== tests/cases/compiler/conditionalExpression1.ts ===
var x: boolean = (true ? 1 : ""); // should be an error
>x : boolean
>(true ? 1 : "") : 1 | ""
>true ? 1 : "" : 1 | ""
>(true ? 1 : "") : "" | 1
>true ? 1 : "" : "" | 1
>true : true
>1 : 1
>"" : ""
@@ -15,7 +15,7 @@ var b = false ? undefined : 0;
var c = false ? 1 : 0;
>c : number
>false ? 1 : 0 : 1 | 0
>false ? 1 : 0 : 0 | 1
>false : false
>1 : 1
>0 : 0
@@ -218,7 +218,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
//Expr1 and Expr2 are literals
var result11: any = true ? 1 : 'string';
>result11 : any
>true ? 1 : 'string' : 1 | "string"
>true ? 1 : 'string' : "string" | 1
>true : true
>1 : 1
>'string' : "string"
@@ -589,8 +589,8 @@ function zeroOf<T extends number | string | boolean>(value: T) {
><ZeroOf<T>>(typeof value === "number" ? 0 : typeof value === "string" ? "" : false) : ZeroOf<T>
>ZeroOf : ZeroOf<T>
>T : T
>(typeof value === "number" ? 0 : typeof value === "string" ? "" : false) : false | 0 | ""
>typeof value === "number" ? 0 : typeof value === "string" ? "" : false : false | 0 | ""
>(typeof value === "number" ? 0 : typeof value === "string" ? "" : false) : false | "" | 0
>typeof value === "number" ? 0 : typeof value === "string" ? "" : false : false | "" | 0
>typeof value === "number" : boolean
>typeof value : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
>value : T
@@ -24,7 +24,7 @@ var y = [() => new c()];
var k: (() => c) | string = (() => new c()) || "";
>k : string | (() => c)
>c : c
>(() => new c()) || "" : (() => c) | ""
>(() => new c()) || "" : "" | (() => c)
>(() => new c()) : () => c
>() => new c() : () => c
>new c() : c
@@ -555,7 +555,7 @@ class C2 {
>bar : () => 1 | 0
return cond ? 0 : 1;
>cond ? 0 : 1 : 1 | 0
>cond ? 0 : 1 : 0 | 1
>cond : boolean
>0 : 0
>1 : 1
@@ -107,7 +107,7 @@ function f5(x: number, y: 1 | 2) {
>y : 1 | 2
x; // 0 | 1 | 2
>x : 1 | 2 | 0
>x : 0 | 1 | 2
}
}
@@ -126,7 +126,7 @@ function f6(x: number, y: 1 | 2) {
>x : number
x; // 0 | 1 | 2
>x : 1 | 2 | 0
>x : 0 | 1 | 2
}
}
@@ -15,7 +15,7 @@ var i: I<string>;
>I : I<T>
var y = new i(""); // y should be string
>y : string
>y : ""
>new i("") : ""
>i : I<string>
>"" : ""
@@ -26,7 +26,7 @@ export function removeClass (node:HTMLElement, className:string) {
>rightDelimiter : any
return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : '';
>leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : '' : " " | ""
>leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : '' : "" | " "
>leftDelimiter.length + rightDelimiter.length === 2 : boolean
>leftDelimiter.length + rightDelimiter.length : any
>leftDelimiter.length : any
@@ -144,14 +144,14 @@ function f2<T, U>(x: T, y: U) {
var r2 = true ? '' : x;
>r2 : string | T
>true ? '' : x : T | ""
>true ? '' : x : "" | T
>true : true
>'' : ""
>x : T
var r2 = true ? x : '';
>r2 : string | T
>true ? x : '' : T | ""
>true ? x : '' : "" | T
>true : true
>x : T
>'' : ""
@@ -259,14 +259,14 @@ function f6<T extends String>(x: T) {
var r2 = true ? '' : x; // ok
>r2 : string | T
>true ? '' : x : T | ""
>true ? '' : x : "" | T
>true : true
>'' : ""
>x : T
var r2 = true ? x : ''; // ok
>r2 : string | T
>true ? x : '' : T | ""
>true ? x : '' : "" | T
>true : true
>x : T
>'' : ""
@@ -699,19 +699,19 @@ g(N["s"]);
// falsy expressions
s || "";
>s || "" : unique symbol | ""
>s || "" : "" | unique symbol
>s : unique symbol
>"" : ""
N.s || "";
>N.s || "" : unique symbol | ""
>N.s || "" : "" | unique symbol
>N.s : unique symbol
>N : typeof N
>s : unique symbol
>"" : ""
N["s"] || "";
>N["s"] || "" : unique symbol | ""
>N["s"] || "" : "" | unique symbol
>N["s"] : unique symbol
>N : typeof N
>"s" : "s"
@@ -699,19 +699,19 @@ g(N["s"]);
// falsy expressions
s || "";
>s || "" : unique symbol | ""
>s || "" : "" | unique symbol
>s : unique symbol
>"" : ""
N.s || "";
>N.s || "" : unique symbol | ""
>N.s || "" : "" | unique symbol
>N.s : unique symbol
>N : typeof N
>s : unique symbol
>"" : ""
N["s"] || "";
>N["s"] || "" : unique symbol | ""
>N["s"] || "" : "" | unique symbol
>N["s"] : unique symbol
>N : typeof N
>"s" : "s"