diff --git a/tests/baselines/reference/ES5for-of32.types b/tests/baselines/reference/ES5for-of32.types index 6fe5ba2008b..034d7a3b1ea 100644 --- a/tests/baselines/reference/ES5for-of32.types +++ b/tests/baselines/reference/ES5for-of32.types @@ -18,7 +18,7 @@ for (let num of array) { if (sum === 0) { >sum === 0 : boolean >sum : number ->0 : number +>0 : 0 array = [4,5,6] >array = [4,5,6] : number[] diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types b/tests/baselines/reference/TypeGuardWithEnumUnion.types index 05d55cb0dbb..bf5625e0c99 100644 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.types @@ -14,7 +14,7 @@ function f1(x: Color | string) { >typeof x === "number" : boolean >typeof x : string >x : Color | string ->"number" : string +>"number" : "number" var y = x; >y : Color @@ -43,7 +43,7 @@ function f2(x: Color | string | string[]) { >typeof x === "object" : boolean >typeof x : string >x : Color | string | string[] ->"object" : string +>"object" : "object" var y = x; >y : string[] @@ -56,7 +56,7 @@ function f2(x: Color | string | string[]) { >typeof x === "number" : boolean >typeof x : string >x : string[] | Color | string ->"number" : string +>"number" : "number" var z = x; >z : Color @@ -78,7 +78,7 @@ function f2(x: Color | string | string[]) { >typeof x === "string" : boolean >typeof x : string >x : Color | string[] | string ->"string" : string +>"string" : "string" var a = x; >a : string diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.types b/tests/baselines/reference/amdImportAsPrimaryExpression.types index eab0b168f44..4c2f47f4d59 100644 --- a/tests/baselines/reference/amdImportAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportAsPrimaryExpression.types @@ -9,7 +9,7 @@ if(foo.E1.A === 0){ >foo : typeof foo >E1 : typeof foo.E1 >A : foo.E1 ->0 : number +>0 : 0 // Should cause runtime import - interesting optimization possibility, as gets inlined to 0. } diff --git a/tests/baselines/reference/anonymousClassExpression1.types b/tests/baselines/reference/anonymousClassExpression1.types index 1e38399f01e..0fbffffdf4b 100644 --- a/tests/baselines/reference/anonymousClassExpression1.types +++ b/tests/baselines/reference/anonymousClassExpression1.types @@ -6,5 +6,5 @@ function f() { >typeof class {} === "function" : boolean >typeof class {} : string >class {} : typeof (Anonymous class) ->"function" : string +>"function" : "function" } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types index 244160dcc6b..477d36982f4 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types @@ -25,7 +25,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } @@ -63,7 +63,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 continue; } @@ -104,7 +104,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break loop; >loop : any @@ -146,7 +146,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 continue loop; >loop : any diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types index 0753391d5c2..ee69f9a5a9f 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types @@ -26,7 +26,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } @@ -96,7 +96,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 continue; } @@ -168,7 +168,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break loop2; >loop2 : any @@ -248,7 +248,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 continue loop2; >loop2 : any diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types index 006f536ccca..c3576bbccd2 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types @@ -28,7 +28,7 @@ function f1() { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return 1; >1 : number diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types index 530978dc722..47a0fd52891 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types @@ -25,7 +25,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { if (x == 1) >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; else diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types index 673c0788a03..c4287869ec0 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types @@ -29,13 +29,13 @@ function f1() { if (x == 1) >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; else if (y == 2) >y == 2 : boolean >y : number ->2 : number +>2 : 2 y = 5; >y = 5 : number @@ -85,13 +85,13 @@ function f2() { if (x == 1) >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; else if (y == 2) >y == 2 : boolean >y : number ->2 : number +>2 : 2 y = 5; >y = 5 : number diff --git a/tests/baselines/reference/capturedLetConstInLoop1.types b/tests/baselines/reference/capturedLetConstInLoop1.types index bed3db55d7c..c60ac25ce1f 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1.types +++ b/tests/baselines/reference/capturedLetConstInLoop1.types @@ -52,8 +52,8 @@ for (let x = 0; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -85,8 +85,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -140,8 +140,8 @@ for (let x = 0, y = 1; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -183,8 +183,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -265,8 +265,8 @@ for (const x = 0; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -300,8 +300,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -351,8 +351,8 @@ for (const x = 0, y = 1; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -398,8 +398,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number diff --git a/tests/baselines/reference/capturedLetConstInLoop11.types b/tests/baselines/reference/capturedLetConstInLoop11.types index 93e18f2cb27..09fad9f2023 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11.types +++ b/tests/baselines/reference/capturedLetConstInLoop11.types @@ -21,7 +21,7 @@ function foo() { >a : number case 0: return () => a; ->0 : number +>0 : 0 >() => a : () => number >a : number } diff --git a/tests/baselines/reference/capturedLetConstInLoop11_ES6.types b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types index de75d5d1511..d6fd971202c 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types @@ -21,7 +21,7 @@ function foo() { >a : number case 0: return () => a; ->0 : number +>0 : 0 >() => a : () => number >a : number } diff --git a/tests/baselines/reference/capturedLetConstInLoop1_ES6.types b/tests/baselines/reference/capturedLetConstInLoop1_ES6.types index 47b12586684..cee71c0d5cd 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop1_ES6.types @@ -52,8 +52,8 @@ for (let x = 0; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -85,8 +85,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -140,8 +140,8 @@ for (let x = 0, y = 1; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -183,8 +183,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -265,8 +265,8 @@ for (const x = 0; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -300,8 +300,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -351,8 +351,8 @@ for (const x = 0, y = 1; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -398,8 +398,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number diff --git a/tests/baselines/reference/capturedLetConstInLoop2.types b/tests/baselines/reference/capturedLetConstInLoop2.types index 2872eb4c763..f4f7a926f89 100644 --- a/tests/baselines/reference/capturedLetConstInLoop2.types +++ b/tests/baselines/reference/capturedLetConstInLoop2.types @@ -103,8 +103,8 @@ function foo2(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let a = arguments.length; >a : number @@ -158,8 +158,8 @@ function foo3(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } function foo4(x) { @@ -249,8 +249,8 @@ function foo6(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -317,8 +317,8 @@ function foo7(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } @@ -464,8 +464,8 @@ function foo2_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const a = arguments.length; >a : number @@ -520,8 +520,8 @@ function foo3_c(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } function foo4_c(x) { @@ -607,8 +607,8 @@ function foo6_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y =1 ; >x : number @@ -679,8 +679,8 @@ function foo7_c(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/capturedLetConstInLoop2_ES6.types b/tests/baselines/reference/capturedLetConstInLoop2_ES6.types index 8a4d9c82628..80e455e44ce 100644 --- a/tests/baselines/reference/capturedLetConstInLoop2_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop2_ES6.types @@ -102,8 +102,8 @@ function foo2(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let a = arguments.length; >a : number @@ -157,8 +157,8 @@ function foo3(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } function foo4(x) { @@ -248,8 +248,8 @@ function foo6(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -316,8 +316,8 @@ function foo7(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } @@ -463,8 +463,8 @@ function foo2_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const a = arguments.length; >a : number @@ -519,8 +519,8 @@ function foo3_c(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } function foo4_c(x) { @@ -606,8 +606,8 @@ function foo6_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y =1 ; >x : number @@ -678,8 +678,8 @@ function foo7_c(x) { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/capturedLetConstInLoop3.types b/tests/baselines/reference/capturedLetConstInLoop3.types index 9c0c188b727..3f35072fdb2 100644 --- a/tests/baselines/reference/capturedLetConstInLoop3.types +++ b/tests/baselines/reference/capturedLetConstInLoop3.types @@ -114,8 +114,8 @@ function foo2(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x = 1; >x : number @@ -173,8 +173,8 @@ function foo3(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -275,8 +275,8 @@ function foo6(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -344,8 +344,8 @@ function foo7(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -508,8 +508,8 @@ function foo2_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -568,8 +568,8 @@ function foo3_c(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -666,8 +666,8 @@ function foo6_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -739,8 +739,8 @@ function foo7_c(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any diff --git a/tests/baselines/reference/capturedLetConstInLoop3_ES6.types b/tests/baselines/reference/capturedLetConstInLoop3_ES6.types index 03377d913c9..3c7776a6651 100644 --- a/tests/baselines/reference/capturedLetConstInLoop3_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop3_ES6.types @@ -115,8 +115,8 @@ function foo2(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x = 1; >x : number @@ -174,8 +174,8 @@ function foo3(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -276,8 +276,8 @@ function foo6(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -345,8 +345,8 @@ function foo7(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -509,8 +509,8 @@ function foo2_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -569,8 +569,8 @@ function foo3_c(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -667,8 +667,8 @@ function foo6_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -740,8 +740,8 @@ function foo7_c(x) { } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any diff --git a/tests/baselines/reference/capturedLetConstInLoop4.types b/tests/baselines/reference/capturedLetConstInLoop4.types index 1bc928cefe4..16226243c53 100644 --- a/tests/baselines/reference/capturedLetConstInLoop4.types +++ b/tests/baselines/reference/capturedLetConstInLoop4.types @@ -96,8 +96,8 @@ for (let x = 0; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -141,8 +141,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -208,8 +208,8 @@ for (let x = 0, y = 1; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -263,8 +263,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -394,8 +394,8 @@ for (const x = 0; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x =1; >x : number @@ -441,8 +441,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -504,8 +504,8 @@ for (const x = 0, y = 1; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -563,8 +563,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number diff --git a/tests/baselines/reference/capturedLetConstInLoop4_ES6.types b/tests/baselines/reference/capturedLetConstInLoop4_ES6.types index cf44c7b6981..fba7d88ec48 100644 --- a/tests/baselines/reference/capturedLetConstInLoop4_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop4_ES6.types @@ -96,8 +96,8 @@ for (let x = 0; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -141,8 +141,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -208,8 +208,8 @@ for (let x = 0, y = 1; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -263,8 +263,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -394,8 +394,8 @@ for (const x = 0; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x =1; >x : number @@ -441,8 +441,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -504,8 +504,8 @@ for (const x = 0, y = 1; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -563,8 +563,8 @@ do { } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number diff --git a/tests/baselines/reference/capturedLetConstInLoop5.types b/tests/baselines/reference/capturedLetConstInLoop5.types index b7b4b880dc4..098a1ce70a4 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5.types +++ b/tests/baselines/reference/capturedLetConstInLoop5.types @@ -33,7 +33,7 @@ function foo0(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } @@ -74,7 +74,7 @@ function foo00(x) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" return; } @@ -120,7 +120,7 @@ function foo1(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -138,8 +138,8 @@ function foo2(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x = 1; >x : number @@ -166,7 +166,7 @@ function foo2(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -206,14 +206,14 @@ function foo3(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -259,7 +259,7 @@ function foo4(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -311,7 +311,7 @@ function foo5(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -330,8 +330,8 @@ function foo6(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -362,7 +362,7 @@ function foo6(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } @@ -408,14 +408,14 @@ function foo7(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -466,7 +466,7 @@ function foo8(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -508,7 +508,7 @@ function foo0_c(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } @@ -549,7 +549,7 @@ function foo00_c(x) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" return; } @@ -593,7 +593,7 @@ function foo1_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -611,8 +611,8 @@ function foo2_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -639,7 +639,7 @@ function foo2_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -680,14 +680,14 @@ function foo3_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -731,7 +731,7 @@ function foo4_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -781,7 +781,7 @@ function foo5_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -800,8 +800,8 @@ function foo6_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -834,7 +834,7 @@ function foo6_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -882,14 +882,14 @@ function foo7_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -938,7 +938,7 @@ function foo8_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.types b/tests/baselines/reference/capturedLetConstInLoop5_ES6.types index 855bbfc6308..78b41d7cdf3 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.types @@ -34,7 +34,7 @@ function foo0(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } @@ -75,7 +75,7 @@ function foo00(x) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" return; } @@ -121,7 +121,7 @@ function foo1(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -139,8 +139,8 @@ function foo2(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x = 1; >x : number @@ -167,7 +167,7 @@ function foo2(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -207,14 +207,14 @@ function foo3(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -260,7 +260,7 @@ function foo4(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -312,7 +312,7 @@ function foo5(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -331,8 +331,8 @@ function foo6(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -363,7 +363,7 @@ function foo6(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } @@ -409,14 +409,14 @@ function foo7(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } } while (1 === 1); >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -467,7 +467,7 @@ function foo8(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -509,7 +509,7 @@ function foo0_c(x) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 return; } @@ -550,7 +550,7 @@ function foo00_c(x) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" return; } @@ -594,7 +594,7 @@ function foo1_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -612,8 +612,8 @@ function foo2_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -640,7 +640,7 @@ function foo2_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -681,14 +681,14 @@ function foo3_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -732,7 +732,7 @@ function foo4_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -782,7 +782,7 @@ function foo5_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -801,8 +801,8 @@ function foo6_c(x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -835,7 +835,7 @@ function foo6_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } @@ -883,14 +883,14 @@ function foo7_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 use(v); >use(v) : any @@ -939,7 +939,7 @@ function foo8_c(x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 return; } diff --git a/tests/baselines/reference/capturedLetConstInLoop6.types b/tests/baselines/reference/capturedLetConstInLoop6.types index f2b1103305f..a7d28222bb0 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6.types +++ b/tests/baselines/reference/capturedLetConstInLoop6.types @@ -17,14 +17,14 @@ for (let x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -47,14 +47,14 @@ for (let x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } @@ -83,14 +83,14 @@ for (let x = 0; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -98,8 +98,8 @@ for (let x = 0; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -117,14 +117,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -147,21 +147,21 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -189,14 +189,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -230,14 +230,14 @@ for (let x = 0, y = 1; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -245,8 +245,8 @@ for (let x = 0, y = 1; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -269,14 +269,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -304,21 +304,21 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -350,14 +350,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -382,14 +382,14 @@ for (const x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -412,14 +412,14 @@ for (const x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } @@ -446,14 +446,14 @@ for (const x = 0; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -461,8 +461,8 @@ for (const x = 0; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -481,14 +481,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -512,21 +512,21 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -552,14 +552,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -591,14 +591,14 @@ for (const x = 0, y = 1; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -606,8 +606,8 @@ for (const x = 0, y = 1; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -632,14 +632,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -669,21 +669,21 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -713,14 +713,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.types b/tests/baselines/reference/capturedLetConstInLoop6_ES6.types index cfd55a63aaa..14635c0cd1c 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.types @@ -17,14 +17,14 @@ for (let x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -47,14 +47,14 @@ for (let x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } @@ -83,14 +83,14 @@ for (let x = 0; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -98,8 +98,8 @@ for (let x = 0; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -117,14 +117,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -147,21 +147,21 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -189,14 +189,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -230,14 +230,14 @@ for (let x = 0, y = 1; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -245,8 +245,8 @@ for (let x = 0, y = 1; x < 1; ++x) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -269,14 +269,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -304,21 +304,21 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (let y = 0; y < 1; ++y) { >y : number @@ -350,14 +350,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -382,14 +382,14 @@ for (const x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } @@ -412,14 +412,14 @@ for (const x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } @@ -446,14 +446,14 @@ for (const x = 0; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -461,8 +461,8 @@ for (const x = 0; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -481,14 +481,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -512,21 +512,21 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -552,14 +552,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -591,14 +591,14 @@ for (const x = 0, y = 1; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -606,8 +606,8 @@ for (const x = 0, y = 1; x < 1;) { while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -632,14 +632,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } @@ -669,21 +669,21 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 for (const y = 0; y < 1;) { >y : number @@ -713,14 +713,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } diff --git a/tests/baselines/reference/capturedLetConstInLoop7.types b/tests/baselines/reference/capturedLetConstInLoop7.types index 29ea34e39a1..641ccb9dbea 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7.types +++ b/tests/baselines/reference/capturedLetConstInLoop7.types @@ -20,14 +20,14 @@ for (let x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l0; >l0 : any @@ -35,14 +35,14 @@ for (let x of []) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l0; >l0 : any @@ -69,14 +69,14 @@ for (let x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break l00; >l00 : any @@ -84,14 +84,14 @@ for (let x in []) { if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue l00; >l00 : any @@ -123,14 +123,14 @@ for (let x = 0; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -138,14 +138,14 @@ for (let x = 0; x < 1; ++x) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -157,8 +157,8 @@ l2: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -176,14 +176,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l2; >l2 : any @@ -191,14 +191,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l2; >l2 : any @@ -225,14 +225,14 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l3; >l3 : any @@ -240,22 +240,22 @@ do { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l3; >l3 : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l4: >l4 : any @@ -286,14 +286,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l4; >l4 : any @@ -301,14 +301,14 @@ for (let y = 0; y < 1; ++y) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l4; >l4 : any @@ -346,14 +346,14 @@ for (let x = 0, y = 1; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l5; >l5 : any @@ -361,14 +361,14 @@ for (let x = 0, y = 1; x < 1; ++x) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l5; >l5 : any @@ -380,8 +380,8 @@ l6: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -404,14 +404,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l6; >l6 : any @@ -419,14 +419,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l6; >l6 : any @@ -459,14 +459,14 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l7; >l7 : any @@ -474,22 +474,22 @@ do { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l7; >l7 : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l8: >l8 : any @@ -524,14 +524,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l8; >l8 : any @@ -539,14 +539,14 @@ for (let y = 0; y < 1; ++y) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l8; >l8 : any @@ -574,14 +574,14 @@ for (const x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l0_c; >l0_c : any @@ -589,14 +589,14 @@ for (const x of []) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l0_c; >l0_c : any @@ -623,14 +623,14 @@ for (const x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break l00_c; >l00_c : any @@ -638,14 +638,14 @@ for (const x in []) { if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue l00_c; >l00_c : any @@ -675,14 +675,14 @@ for (const x = 0; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1_c; >l1_c : any @@ -690,14 +690,14 @@ for (const x = 0; x < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1_c; >l1_c : any @@ -709,8 +709,8 @@ l2_c: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -729,14 +729,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l2_c; >l2_c : any @@ -744,14 +744,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l2_c; >l2_c : any @@ -779,14 +779,14 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l3_c; >l3_c : any @@ -794,22 +794,22 @@ do { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l3_c; >l3_c : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l4_c: >l4_c : any @@ -838,14 +838,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l4_c; >l4_c : any @@ -853,14 +853,14 @@ for (const y = 0; y < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l4_c; >l4_c : any @@ -896,14 +896,14 @@ for (const x = 0, y = 1; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l5_c; >l5_c : any @@ -911,14 +911,14 @@ for (const x = 0, y = 1; x < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l5_c; >l5_c : any @@ -930,8 +930,8 @@ l6_c: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -956,14 +956,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l6_c; >l6_c : any @@ -971,14 +971,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l6_c; >l6_c : any @@ -1013,14 +1013,14 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l7_c; >l7_c : any @@ -1028,22 +1028,22 @@ do { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l7_c; >l7_c : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l8_c: >l8_c : any @@ -1076,14 +1076,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l8_c; >l8_c : any @@ -1091,14 +1091,14 @@ for (const y = 0; y < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l8_c; >l8_c : any diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.types b/tests/baselines/reference/capturedLetConstInLoop7_ES6.types index c72afb41942..666f3e33e0f 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.types @@ -20,14 +20,14 @@ for (let x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l0; >l0 : any @@ -35,14 +35,14 @@ for (let x of []) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l0; >l0 : any @@ -69,14 +69,14 @@ for (let x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break l00; >l00 : any @@ -84,14 +84,14 @@ for (let x in []) { if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue l00; >l00 : any @@ -123,14 +123,14 @@ for (let x = 0; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -138,14 +138,14 @@ for (let x = 0; x < 1; ++x) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -157,8 +157,8 @@ l2: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -176,14 +176,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l2; >l2 : any @@ -191,14 +191,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l2; >l2 : any @@ -225,14 +225,14 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l3; >l3 : any @@ -240,22 +240,22 @@ do { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l3; >l3 : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l4: >l4 : any @@ -286,14 +286,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l4; >l4 : any @@ -301,14 +301,14 @@ for (let y = 0; y < 1; ++y) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l4; >l4 : any @@ -346,14 +346,14 @@ for (let x = 0, y = 1; x < 1; ++x) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l5; >l5 : any @@ -361,14 +361,14 @@ for (let x = 0, y = 1; x < 1; ++x) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l5; >l5 : any @@ -380,8 +380,8 @@ l6: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x, y; >x : any @@ -404,14 +404,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l6; >l6 : any @@ -419,14 +419,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l6; >l6 : any @@ -459,14 +459,14 @@ do { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l7; >l7 : any @@ -474,22 +474,22 @@ do { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l7; >l7 : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l8: >l8 : any @@ -524,14 +524,14 @@ for (let y = 0; y < 1; ++y) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l8; >l8 : any @@ -539,14 +539,14 @@ for (let y = 0; y < 1; ++y) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l8; >l8 : any @@ -574,14 +574,14 @@ for (const x of []) { if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : any ->1 : number +>1 : 1 break l0_c; >l0_c : any @@ -589,14 +589,14 @@ for (const x of []) { if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : any ->2 : number +>2 : 2 continue l0_c; >l0_c : any @@ -623,14 +623,14 @@ for (const x in []) { if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break; } if (x == "1") { >x == "1" : boolean >x : string ->"1" : string +>"1" : "1" break l00_c; >l00_c : any @@ -638,14 +638,14 @@ for (const x in []) { if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue; } if (x == "2") { >x == "2" : boolean >x : string ->"2" : string +>"2" : "2" continue l00_c; >l00_c : any @@ -675,14 +675,14 @@ for (const x = 0; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1_c; >l1_c : any @@ -690,14 +690,14 @@ for (const x = 0; x < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1_c; >l1_c : any @@ -709,8 +709,8 @@ l2_c: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1; >x : number @@ -729,14 +729,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l2_c; >l2_c : any @@ -744,14 +744,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l2_c; >l2_c : any @@ -779,14 +779,14 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l3_c; >l3_c : any @@ -794,22 +794,22 @@ do { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l3_c; >l3_c : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l4_c: >l4_c : any @@ -838,14 +838,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l4_c; >l4_c : any @@ -853,14 +853,14 @@ for (const y = 0; y < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l4_c; >l4_c : any @@ -896,14 +896,14 @@ for (const x = 0, y = 1; x < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l5_c; >l5_c : any @@ -911,14 +911,14 @@ for (const x = 0, y = 1; x < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l5_c; >l5_c : any @@ -930,8 +930,8 @@ l6_c: while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 const x = 1, y = 1; >x : number @@ -956,14 +956,14 @@ while (1 === 1) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l6_c; >l6_c : any @@ -971,14 +971,14 @@ while (1 === 1) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l6_c; >l6_c : any @@ -1013,14 +1013,14 @@ do { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l7_c; >l7_c : any @@ -1028,22 +1028,22 @@ do { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l7_c; >l7_c : any } } while (1 === 1) >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 l8_c: >l8_c : any @@ -1076,14 +1076,14 @@ for (const y = 0; y < 1;) { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l8_c; >l8_c : any @@ -1091,14 +1091,14 @@ for (const y = 0; y < 1;) { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l8_c; >l8_c : any diff --git a/tests/baselines/reference/capturedLetConstInLoop8.types b/tests/baselines/reference/capturedLetConstInLoop8.types index 9c3db88535c..618e71038ff 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8.types +++ b/tests/baselines/reference/capturedLetConstInLoop8.types @@ -55,14 +55,14 @@ function foo() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break; } if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -70,7 +70,7 @@ function foo() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break ll1; >ll1 : any @@ -78,7 +78,7 @@ function foo() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 continue l0; >l0 : any @@ -87,14 +87,14 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -102,7 +102,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue ll1; >ll1 : any @@ -110,7 +110,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "123" >"123" : string @@ -118,7 +118,7 @@ function foo() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } @@ -126,14 +126,14 @@ function foo() { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -141,14 +141,14 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -156,7 +156,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l0; >l0 : any @@ -164,7 +164,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "456"; >"456" : string @@ -172,7 +172,7 @@ function foo() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } @@ -230,14 +230,14 @@ function foo_c() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break; } if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -245,7 +245,7 @@ function foo_c() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break ll1; >ll1 : any @@ -253,7 +253,7 @@ function foo_c() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 continue l0; >l0 : any @@ -262,14 +262,14 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -277,7 +277,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue ll1; >ll1 : any @@ -285,7 +285,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "123" >"123" : string @@ -293,7 +293,7 @@ function foo_c() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } @@ -301,14 +301,14 @@ function foo_c() { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -316,14 +316,14 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -331,7 +331,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l0; >l0 : any @@ -339,7 +339,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "456"; >"456" : string @@ -347,7 +347,7 @@ function foo_c() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } diff --git a/tests/baselines/reference/capturedLetConstInLoop8_ES6.types b/tests/baselines/reference/capturedLetConstInLoop8_ES6.types index 7911e9b63a2..0b877d27a46 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop8_ES6.types @@ -55,14 +55,14 @@ function foo() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break; } if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -70,7 +70,7 @@ function foo() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break ll1; >ll1 : any @@ -78,7 +78,7 @@ function foo() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 continue l0; >l0 : any @@ -87,14 +87,14 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -102,7 +102,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue ll1; >ll1 : any @@ -110,7 +110,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "123" >"123" : string @@ -118,7 +118,7 @@ function foo() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } @@ -126,14 +126,14 @@ function foo() { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -141,14 +141,14 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -156,7 +156,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l0; >l0 : any @@ -164,7 +164,7 @@ function foo() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "456"; >"456" : string @@ -172,7 +172,7 @@ function foo() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } @@ -230,14 +230,14 @@ function foo_c() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break; } if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -245,7 +245,7 @@ function foo_c() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 break ll1; >ll1 : any @@ -253,7 +253,7 @@ function foo_c() { if (y == 1) { >y == 1 : boolean >y : number ->1 : number +>1 : 1 continue l0; >l0 : any @@ -262,14 +262,14 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -277,7 +277,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue ll1; >ll1 : any @@ -285,7 +285,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "123" >"123" : string @@ -293,7 +293,7 @@ function foo_c() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } @@ -301,14 +301,14 @@ function foo_c() { if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break; } if (x == 1) { >x == 1 : boolean >x : number ->1 : number +>1 : 1 break l1; >l1 : any @@ -316,14 +316,14 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue; } if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l1; >l1 : any @@ -331,7 +331,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 continue l0; >l0 : any @@ -339,7 +339,7 @@ function foo_c() { if (x == 2) { >x == 2 : boolean >x : number ->2 : number +>2 : 2 return "456"; >"456" : string @@ -347,7 +347,7 @@ function foo_c() { if (x == 3) { >x == 3 : boolean >x : number ->3 : number +>3 : 3 return; } diff --git a/tests/baselines/reference/capturedLetConstInLoop9.types b/tests/baselines/reference/capturedLetConstInLoop9.types index 7f793ab6601..9f1bab20148 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9.types +++ b/tests/baselines/reference/capturedLetConstInLoop9.types @@ -42,7 +42,7 @@ for (let x = 0; x < 1; ++x) { >x : any case 1: ->1 : number +>1 : 1 let x; >x : any @@ -57,8 +57,8 @@ for (let x = 0; x < 1; ++x) { while (1 == 1) { >1 == 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -100,7 +100,7 @@ function foo() { if (a === 1) { >a === 1 : boolean >a : any ->1 : number +>1 : 1 break; } @@ -108,7 +108,7 @@ function foo() { if (a === 2) { >a === 2 : boolean >a : any ->2 : number +>2 : 2 break l0; >l0 : any @@ -132,7 +132,7 @@ function foo() { if (b === 1) { >b === 1 : boolean >b : any ->1 : number +>1 : 1 break; } @@ -141,7 +141,7 @@ function foo() { if (b === 2) { >b === 2 : boolean >b : any ->2 : number +>2 : 2 break l0; >l0 : any @@ -153,7 +153,7 @@ function foo() { if (b === 3) { >b === 3 : boolean >b : any ->3 : number +>3 : 3 break l1; >l1 : any @@ -183,7 +183,7 @@ function foo() { if (b === 1) { >b === 1 : boolean >b : any ->1 : number +>1 : 1 break; } @@ -191,7 +191,7 @@ function foo() { if (b === 2) { >b === 2 : boolean >b : any ->2 : number +>2 : 2 break l0; >l0 : any @@ -242,22 +242,22 @@ function foo2() { if (x === 1) { >x === 1 : boolean >x : any ->1 : number +>1 : 1 break; } else if (x === 2) { >x === 2 : boolean >x : any ->2 : number +>2 : 2 continue; } while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 if (x) { >x : any @@ -273,10 +273,10 @@ function foo2() { >x : any case 1: break; ->1 : number +>1 : 1 case 2: continue; ->2 : number +>2 : 2 } for (let y of []) { @@ -287,10 +287,10 @@ function foo2() { >y : any case 1: break; ->1 : number +>1 : 1 case 2: continue; ->2 : number +>2 : 2 } } } diff --git a/tests/baselines/reference/capturedLetConstInLoop9_ES6.types b/tests/baselines/reference/capturedLetConstInLoop9_ES6.types index dfbfa387ed4..8a4adafe340 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop9_ES6.types @@ -43,7 +43,7 @@ for (let x = 0; x < 1; ++x) { >x : any case 1: ->1 : number +>1 : 1 let x; >x : any @@ -58,8 +58,8 @@ for (let x = 0; x < 1; ++x) { while (1 == 1) { >1 == 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 let x; >x : any @@ -101,7 +101,7 @@ function foo() { if (a === 1) { >a === 1 : boolean >a : any ->1 : number +>1 : 1 break; } @@ -109,7 +109,7 @@ function foo() { if (a === 2) { >a === 2 : boolean >a : any ->2 : number +>2 : 2 break l0; >l0 : any @@ -133,7 +133,7 @@ function foo() { if (b === 1) { >b === 1 : boolean >b : any ->1 : number +>1 : 1 break; } @@ -142,7 +142,7 @@ function foo() { if (b === 2) { >b === 2 : boolean >b : any ->2 : number +>2 : 2 break l0; >l0 : any @@ -154,7 +154,7 @@ function foo() { if (b === 3) { >b === 3 : boolean >b : any ->3 : number +>3 : 3 break l1; >l1 : any @@ -184,7 +184,7 @@ function foo() { if (b === 1) { >b === 1 : boolean >b : any ->1 : number +>1 : 1 break; } @@ -192,7 +192,7 @@ function foo() { if (b === 2) { >b === 2 : boolean >b : any ->2 : number +>2 : 2 break l0; >l0 : any @@ -242,22 +242,22 @@ function foo2() { if (x === 1) { >x === 1 : boolean >x : any ->1 : number +>1 : 1 break; } else if (x === 2) { >x === 2 : boolean >x : any ->2 : number +>2 : 2 continue; } while (1 === 1) { >1 === 1 : boolean ->1 : number ->1 : number +>1 : 1 +>1 : 1 if (x) { >x : any @@ -273,10 +273,10 @@ function foo2() { >x : any case 1: break; ->1 : number +>1 : 1 case 2: continue; ->2 : number +>2 : 2 } for (let y of []) { @@ -287,10 +287,10 @@ function foo2() { >y : any case 1: break; ->1 : number +>1 : 1 case 2: continue; ->2 : number +>2 : 2 } } } diff --git a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.types b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.types index fa394b4e0bd..30f584894fc 100644 --- a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.types +++ b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.types @@ -23,7 +23,7 @@ class A { >v : string case "test": use(this); ->"test" : string +>"test" : "test" >use(this) : void >use : (a: any) => void >this : this diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types index c342f0ea002..f8e510230e2 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types @@ -7,7 +7,7 @@ if (typeof x !== "string") { >typeof x !== "string" : boolean >typeof x : string >x : string | StringTreeCollection ->"string" : string +>"string" : "string" x[0] = ""; >x[0] = "" : string diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types index 67077683d87..fa804eada44 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types @@ -227,12 +227,12 @@ var re5 = E.a == 0; >E.a : E >E : typeof E >a : E ->0 : number +>0 : 0 var re6 = 0 == E.a; >re6 : boolean >0 == E.a : boolean ->0 : number +>0 : 0 >E.a : E >E : typeof E >a : E @@ -272,12 +272,12 @@ var rf5 = E.a != 0; >E.a : E >E : typeof E >a : E ->0 : number +>0 : 0 var rf6 = 0 != E.a; >rf6 : boolean >0 != E.a : boolean ->0 : number +>0 : 0 >E.a : E >E : typeof E >a : E @@ -317,12 +317,12 @@ var rg5 = E.a === 0; >E.a : E >E : typeof E >a : E ->0 : number +>0 : 0 var rg6 = 0 === E.a; >rg6 : boolean >0 === E.a : boolean ->0 : number +>0 : 0 >E.a : E >E : typeof E >a : E @@ -362,12 +362,12 @@ var rh5 = E.a !== 0; >E.a : E >E : typeof E >a : E ->0 : number +>0 : 0 var rh6 = 0 !== E.a; >rh6 : boolean >0 !== E.a : boolean ->0 : number +>0 : 0 >E.a : E >E : typeof E >a : E diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types index 4d28939b696..ec3bd526e9e 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types @@ -122,7 +122,7 @@ typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >typeof "123" == "string" : boolean >typeof "123" : string >"123" : string ->"string" : string +>"string" : "string" >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -264,7 +264,7 @@ var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >typeof "123" == "string" : boolean >typeof "123" : string >"123" : string ->"string" : string +>"string" : "string" >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -301,7 +301,7 @@ var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoo >typeof "123" === "string" : boolean >typeof "123" : string >"123" : string ->"string" : string +>"string" : "string" >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/constLocalsInFunctionExpressions.types b/tests/baselines/reference/constLocalsInFunctionExpressions.types index e9f0086f6b1..db1da04e0ca 100644 --- a/tests/baselines/reference/constLocalsInFunctionExpressions.types +++ b/tests/baselines/reference/constLocalsInFunctionExpressions.types @@ -14,7 +14,7 @@ function f1() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" const f = () => x.length; >f : () => number @@ -37,7 +37,7 @@ function f2() { >typeof x !== "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" return; } @@ -61,7 +61,7 @@ function f3() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" const f = function() { return x.length; }; >f : () => number @@ -84,7 +84,7 @@ function f4() { >typeof x !== "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" return; } @@ -108,7 +108,7 @@ function f5() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" const f = () => () => x.length; >f : () => () => number diff --git a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types index 2aeb286d604..885b67d4140 100644 --- a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types +++ b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types @@ -11,7 +11,7 @@ function foo() { if (i === 0) { >i === 0 : boolean >i : number ->0 : number +>0 : 0 continue; } diff --git a/tests/baselines/reference/controlFlowCaching.types b/tests/baselines/reference/controlFlowCaching.types index cd603b274d1..137fbc3d19c 100644 --- a/tests/baselines/reference/controlFlowCaching.types +++ b/tests/baselines/reference/controlFlowCaching.types @@ -43,7 +43,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >leftBottom : boolean >position !== "rightOrTop" : boolean >position : any ->"rightOrTop" : string +>"rightOrTop" : "rightOrTop" >rotation : number >o.rotation % 360 : number >o.rotation : any @@ -180,7 +180,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >o.titleGap : any >o : any >titleGap : any ->0 : number +>0 : 0 >0 : number >o.titleGap || (ta.title && ta.title.gap) || 15 : any >o.titleGap || (ta.title && ta.title.gap) : any @@ -545,7 +545,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >taTitleOrientation : any >taTitleOrientation == "away" : boolean >taTitleOrientation : any ->"away" : string +>"away" : "away" >180 : number >0 : number @@ -570,7 +570,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >labelAlign : any case "start": ->"start" : string +>"start" : "start" labelAlign = "end"; >labelAlign = "end" : string @@ -579,7 +579,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { break; case "end": ->"end" : string +>"end" : "end" labelAlign = "start"; >labelAlign = "start" : string @@ -588,7 +588,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { break; case "middle": ->"middle" : string +>"middle" : "middle" labelOffset.y -= size; >labelOffset.y -= size : number diff --git a/tests/baselines/reference/controlFlowCommaOperator.types b/tests/baselines/reference/controlFlowCommaOperator.types index 53014ceafa7..328bffc42ab 100644 --- a/tests/baselines/reference/controlFlowCommaOperator.types +++ b/tests/baselines/reference/controlFlowCommaOperator.types @@ -19,7 +19,7 @@ function f(x: string | number | boolean) { >typeof x === "string" : boolean >typeof x : string >x : string | number | boolean ->"string" : string +>"string" : "string" x; // string >x : string @@ -38,7 +38,7 @@ function f(x: string | number | boolean) { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" x; // number >x : number diff --git a/tests/baselines/reference/controlFlowDoWhileStatement.types b/tests/baselines/reference/controlFlowDoWhileStatement.types index a82ae1b716e..ffd9f03096f 100644 --- a/tests/baselines/reference/controlFlowDoWhileStatement.types +++ b/tests/baselines/reference/controlFlowDoWhileStatement.types @@ -68,7 +68,7 @@ function c() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" break; } while (cond) diff --git a/tests/baselines/reference/controlFlowForStatement.types b/tests/baselines/reference/controlFlowForStatement.types index cdf049b32d6..d0b0a2e6b8a 100644 --- a/tests/baselines/reference/controlFlowForStatement.types +++ b/tests/baselines/reference/controlFlowForStatement.types @@ -84,7 +84,7 @@ function d() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" >x = 5 : number >x : string | number | boolean >5 : number @@ -109,7 +109,7 @@ function e() { >typeof x !== "string" : boolean >typeof x : string >x : string | number | boolean ->"string" : string +>"string" : "string" >x = "" || true : string | boolean >x : string | number | boolean | RegExp >"" || true : string | boolean @@ -130,7 +130,7 @@ function f() { >typeof x !== "string" : boolean >typeof x : string >x : string | number | boolean ->"string" : string +>"string" : "string" x; // number | boolean >x : number | boolean @@ -139,7 +139,7 @@ function f() { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" x = undefined; >x = undefined : undefined diff --git a/tests/baselines/reference/controlFlowIIFE.types b/tests/baselines/reference/controlFlowIIFE.types index c041de04bc7..dd1fbacc424 100644 --- a/tests/baselines/reference/controlFlowIIFE.types +++ b/tests/baselines/reference/controlFlowIIFE.types @@ -15,7 +15,7 @@ function f1() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" let n = function() { >n : number @@ -43,7 +43,7 @@ function f2() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" let n = (function() { >n : number @@ -75,7 +75,7 @@ function f3() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" let n = (z => x.length + y + z)(y = 1); >n : number diff --git a/tests/baselines/reference/controlFlowPropertyDeclarations.types b/tests/baselines/reference/controlFlowPropertyDeclarations.types index 81c86e8625d..38f05122d69 100644 --- a/tests/baselines/reference/controlFlowPropertyDeclarations.types +++ b/tests/baselines/reference/controlFlowPropertyDeclarations.types @@ -62,7 +62,7 @@ function repeatString(string, times) { if (times === 1) { >times === 1 : boolean >times : any ->1 : number +>1 : 1 return string; >string : any @@ -269,10 +269,10 @@ export class HTMLtoJSX { >parentTag === 'textarea' || parentTag === 'style' : boolean >parentTag === 'textarea' : boolean >parentTag : any ->'textarea' : string +>'textarea' : "textarea" >parentTag === 'style' : boolean >parentTag : any ->'style' : string +>'style' : "style" // Ignore text content of textareas and styles, as it will have already been moved // to a "defaultValue" attribute and "dangerouslySetInnerHTML" attribute respectively. diff --git a/tests/baselines/reference/controlFlowWhileStatement.types b/tests/baselines/reference/controlFlowWhileStatement.types index a17c084228b..33f5d455f9b 100644 --- a/tests/baselines/reference/controlFlowWhileStatement.types +++ b/tests/baselines/reference/controlFlowWhileStatement.types @@ -71,7 +71,7 @@ function c() { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" break; } diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types index 3041b92cf6d..6d9c17b4ab9 100644 --- a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types @@ -19,7 +19,7 @@ function foo(a: string): string | number { if (a === "hello") { >a === "hello" : boolean >a : string ->"hello" : string +>"hello" : "hello" return a.length; >a.length : number diff --git a/tests/baselines/reference/declarationEmitIdentifierPredicates01.types b/tests/baselines/reference/declarationEmitIdentifierPredicates01.types index 7d8a5668265..1129012a80a 100644 --- a/tests/baselines/reference/declarationEmitIdentifierPredicates01.types +++ b/tests/baselines/reference/declarationEmitIdentifierPredicates01.types @@ -9,5 +9,5 @@ export function f(x: any): x is number { >typeof x === "number" : boolean >typeof x : string >x : any ->"number" : string +>"number" : "number" } diff --git a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types index d0f930b7ad4..17b37c79378 100644 --- a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types +++ b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types @@ -31,7 +31,7 @@ class Wat { >() => test == 'abc' : () => boolean >test == 'abc' : boolean >test : string ->'abc' : string +>'abc' : "abc" static whatever() { >whatever : () => void diff --git a/tests/baselines/reference/emptyThenWithoutWarning.types b/tests/baselines/reference/emptyThenWithoutWarning.types index 2dca4059669..5da827deb2c 100644 --- a/tests/baselines/reference/emptyThenWithoutWarning.types +++ b/tests/baselines/reference/emptyThenWithoutWarning.types @@ -8,13 +8,13 @@ if(a === 1 || a === 2 || a === 3) { >a === 1 || a === 2 : boolean >a === 1 : boolean >a : number ->1 : number +>1 : 1 >a === 2 : boolean >a : number ->2 : number +>2 : 2 >a === 3 : boolean >a : number ->3 : number +>3 : 3 } else { let message = "Ooops"; diff --git a/tests/baselines/reference/es3defaultAliasIsQuoted.types b/tests/baselines/reference/es3defaultAliasIsQuoted.types index d3b1ebf105b..59ce62dff1e 100644 --- a/tests/baselines/reference/es3defaultAliasIsQuoted.types +++ b/tests/baselines/reference/es3defaultAliasIsQuoted.types @@ -33,5 +33,5 @@ assert(Foo.CONSTANT === "Foo"); >Foo.CONSTANT : string >Foo : typeof Foo >CONSTANT : string ->"Foo" : string +>"Foo" : "Foo" diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.types b/tests/baselines/reference/exportAssignmentTopLevelClodule.types index 93ce39c3b60..a8a827ba9c3 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelClodule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.types @@ -7,7 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number ->42 : number +>42 : 42 var x = new foo(); >x : foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.types b/tests/baselines/reference/exportAssignmentTopLevelFundule.types index 3464f4294a0..950693dcc62 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelFundule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.types @@ -7,7 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number ->42 : number +>42 : 42 var x = foo(); >x : string diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types index 34971ca9cd6..9851eab1898 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types @@ -7,7 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number ->42 : number +>42 : 42 } diff --git a/tests/baselines/reference/fallFromLastCase1.types b/tests/baselines/reference/fallFromLastCase1.types index 47e444ee17d..1a21727e7a1 100644 --- a/tests/baselines/reference/fallFromLastCase1.types +++ b/tests/baselines/reference/fallFromLastCase1.types @@ -12,7 +12,7 @@ function foo1(a: number) { >a : number case 1: ->1 : number +>1 : 1 use("1"); >use("1") : any @@ -21,7 +21,7 @@ function foo1(a: number) { break; case 2: ->2 : number +>2 : 2 use("2"); >use("2") : any @@ -39,7 +39,7 @@ function foo2(a: number) { >a : number case 1: ->1 : number +>1 : 1 use("1"); >use("1") : any diff --git a/tests/baselines/reference/fatarrowfunctions.types b/tests/baselines/reference/fatarrowfunctions.types index e48b63e50ee..7fd15ee29a7 100644 --- a/tests/baselines/reference/fatarrowfunctions.types +++ b/tests/baselines/reference/fatarrowfunctions.types @@ -208,7 +208,7 @@ function ternaryTest(isWhile:boolean) { >n : any >n === 0 : boolean >n : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/genericArrayPropertyAssignment.types b/tests/baselines/reference/genericArrayPropertyAssignment.types index 6db56dde381..9552d0ac2c9 100644 --- a/tests/baselines/reference/genericArrayPropertyAssignment.types +++ b/tests/baselines/reference/genericArrayPropertyAssignment.types @@ -9,7 +9,7 @@ return list.length ===0; >list.length : number >list : { length: number; } >length : number ->0 : number +>0 : 0 } isEmpty([]); // error diff --git a/tests/baselines/reference/implicitAnyInCatch.types b/tests/baselines/reference/implicitAnyInCatch.types index 015d41b123f..6dda46fd3ca 100644 --- a/tests/baselines/reference/implicitAnyInCatch.types +++ b/tests/baselines/reference/implicitAnyInCatch.types @@ -8,7 +8,7 @@ try { } catch (error) { >error.number : any >error : any >number : any ->-2147024809 : number +>-2147024809 : -2147024809 >2147024809 : number } for (var key in this) { } diff --git a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types index 7b5d60a5261..cdfa4091012 100644 --- a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types @@ -7,7 +7,7 @@ if (typeof x !== "string") { >typeof x !== "string" : boolean >typeof x : string >x : string | StringTreeArray ->"string" : string +>"string" : "string" x.push(""); >x.push("") : number diff --git a/tests/baselines/reference/invalidSwitchBreakStatement.types b/tests/baselines/reference/invalidSwitchBreakStatement.types index 3544da72489..fd0ad2699a0 100644 --- a/tests/baselines/reference/invalidSwitchBreakStatement.types +++ b/tests/baselines/reference/invalidSwitchBreakStatement.types @@ -5,7 +5,7 @@ switch (12) { >12 : number case 5: ->5 : number +>5 : 5 break; } diff --git a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types index fbfe9d3edae..443ed739828 100644 --- a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types +++ b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types @@ -26,7 +26,7 @@ function apply(func, thisArg, args) { >length : number case 0: return func.call(thisArg); ->0 : number +>0 : 0 >func.call(thisArg) : any >func.call : (this: Function, thisArg: any, ...argArray: any[]) => any >func : Function @@ -34,7 +34,7 @@ function apply(func, thisArg, args) { >thisArg : any case 1: return func.call(thisArg, args[0]); ->1 : number +>1 : 1 >func.call(thisArg, args[0]) : any >func.call : (this: Function, thisArg: any, ...argArray: any[]) => any >func : Function @@ -45,7 +45,7 @@ function apply(func, thisArg, args) { >0 : number case 2: return func.call(thisArg, args[0], args[1]); ->2 : number +>2 : 2 >func.call(thisArg, args[0], args[1]) : any >func.call : (this: Function, thisArg: any, ...argArray: any[]) => any >func : Function @@ -59,7 +59,7 @@ function apply(func, thisArg, args) { >1 : number case 3: return func.call(thisArg, args[0], args[1], args[2]); ->3 : number +>3 : 3 >func.call(thisArg, args[0], args[1], args[2]) : any >func.call : (this: Function, thisArg: any, ...argArray: any[]) => any >func : Function diff --git a/tests/baselines/reference/memberAccessOnConstructorType.types b/tests/baselines/reference/memberAccessOnConstructorType.types index a767336ec12..9b8436d6311 100644 --- a/tests/baselines/reference/memberAccessOnConstructorType.types +++ b/tests/baselines/reference/memberAccessOnConstructorType.types @@ -7,5 +7,5 @@ f.arguments == 0; >f.arguments : any >f : new () => void >arguments : any ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/nestedBlockScopedBindings1.types b/tests/baselines/reference/nestedBlockScopedBindings1.types index 6d5b47a348b..e192b0748a5 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings1.types +++ b/tests/baselines/reference/nestedBlockScopedBindings1.types @@ -50,7 +50,7 @@ function a3() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -70,7 +70,7 @@ function a4() { >1 : number case 1: ->1 : number +>1 : 1 let x = 1; >x : number diff --git a/tests/baselines/reference/nestedBlockScopedBindings10.types b/tests/baselines/reference/nestedBlockScopedBindings10.types index ee2701cdcf1..747f2ef1f2b 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings10.types +++ b/tests/baselines/reference/nestedBlockScopedBindings10.types @@ -13,7 +13,7 @@ switch (1) { >1 : number case 1: ->1 : number +>1 : 1 let y; >y : any diff --git a/tests/baselines/reference/nestedBlockScopedBindings11.types b/tests/baselines/reference/nestedBlockScopedBindings11.types index ab7b4228278..4d1914d6f1a 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings11.types +++ b/tests/baselines/reference/nestedBlockScopedBindings11.types @@ -17,7 +17,7 @@ switch (1) { >1 : number case 1: ->1 : number +>1 : 1 let y; >y : any diff --git a/tests/baselines/reference/nestedBlockScopedBindings12.types b/tests/baselines/reference/nestedBlockScopedBindings12.types index 8c1fdda0ce0..ec75d16a37f 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings12.types +++ b/tests/baselines/reference/nestedBlockScopedBindings12.types @@ -18,7 +18,7 @@ switch (1) { >1 : number case 1: ->1 : number +>1 : 1 let y; >y : any diff --git a/tests/baselines/reference/nestedBlockScopedBindings2.types b/tests/baselines/reference/nestedBlockScopedBindings2.types index adb33b4dc76..3e7dbe4b757 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings2.types +++ b/tests/baselines/reference/nestedBlockScopedBindings2.types @@ -71,7 +71,7 @@ function a3() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -95,7 +95,7 @@ function a4() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -123,7 +123,7 @@ function a5() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -139,7 +139,7 @@ function a6() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -150,7 +150,7 @@ function a6() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -166,7 +166,7 @@ function a7() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -181,7 +181,7 @@ function a7() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -197,7 +197,7 @@ function a8() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -208,7 +208,7 @@ function a8() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -228,7 +228,7 @@ function a9() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -243,7 +243,7 @@ function a9() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any diff --git a/tests/baselines/reference/nestedBlockScopedBindings3.types b/tests/baselines/reference/nestedBlockScopedBindings3.types index 37b89242f3e..e10cffb7123 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings3.types +++ b/tests/baselines/reference/nestedBlockScopedBindings3.types @@ -96,7 +96,7 @@ function a3() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -129,7 +129,7 @@ function a4() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -163,7 +163,7 @@ function a5() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any diff --git a/tests/baselines/reference/nestedBlockScopedBindings6.types b/tests/baselines/reference/nestedBlockScopedBindings6.types index 5c8c1fa68fa..fa4fa5ec695 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings6.types +++ b/tests/baselines/reference/nestedBlockScopedBindings6.types @@ -146,7 +146,7 @@ function a4() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -175,7 +175,7 @@ function a5() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -207,7 +207,7 @@ function a6() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any @@ -239,7 +239,7 @@ function a7() { >1 : number case 1: ->1 : number +>1 : 1 let x; >x : any diff --git a/tests/baselines/reference/nestedBlockScopedBindings9.types b/tests/baselines/reference/nestedBlockScopedBindings9.types index b889421e7dd..e27254717fa 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings9.types +++ b/tests/baselines/reference/nestedBlockScopedBindings9.types @@ -12,7 +12,7 @@ switch (1) { >1 : number case 1: ->1 : number +>1 : 1 let y; >y : any diff --git a/tests/baselines/reference/neverType.types b/tests/baselines/reference/neverType.types index 5424f61d1ed..5cd6f419a9d 100644 --- a/tests/baselines/reference/neverType.types +++ b/tests/baselines/reference/neverType.types @@ -70,13 +70,13 @@ function move1(direction: "up" | "down") { >direction : "up" | "down" case "up": ->"up" : string +>"up" : "up" return 1; >1 : number case "down": ->"down" : string +>"down" : "down" return -1; >-1 : number @@ -96,14 +96,14 @@ function move2(direction: "up" | "down") { >direction === "up" ? 1 : direction === "down" ? -1 : error("Should never get here") : number >direction === "up" : boolean >direction : "up" | "down" ->"up" : string +>"up" : "up" >1 : number direction === "down" ? -1 : >direction === "down" ? -1 : error("Should never get here") : number >direction === "down" : boolean >direction : "up" | "down" ->"down" : string +>"down" : "down" >-1 : number >1 : number @@ -166,7 +166,7 @@ function f1(x: string | number) { >typeof x === "boolean" : boolean >typeof x : string >x : string | number ->"boolean" : string +>"boolean" : "boolean" x; // never >x : never @@ -184,7 +184,7 @@ function f2(x: string | number) { >typeof x === "boolean" : boolean >typeof x : string >x : string | number ->"boolean" : string +>"boolean" : "boolean" return x; // never >x : never diff --git a/tests/baselines/reference/noImplicitReturnsInAsync1.types b/tests/baselines/reference/noImplicitReturnsInAsync1.types index 23f0892f30e..1dfc098675c 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync1.types +++ b/tests/baselines/reference/noImplicitReturnsInAsync1.types @@ -8,7 +8,7 @@ async function test(isError: boolean = false) { if (isError === true) { >isError === true : boolean >isError : boolean ->true : boolean +>true : true return; } diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.types b/tests/baselines/reference/objectLiteralArraySpecialization.types index b32eaa0441e..405d8bff472 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.types +++ b/tests/baselines/reference/objectLiteralArraySpecialization.types @@ -52,5 +52,5 @@ thing.doSomething((x, y) => x.name === "bob"); // should not error >x.name : string >x : { name: string; id: number; } >name : string ->"bob" : string +>"bob" : "bob" diff --git a/tests/baselines/reference/operatorsAndIntersectionTypes.types b/tests/baselines/reference/operatorsAndIntersectionTypes.types index 6b5987d3a69..2cf04c6549c 100644 --- a/tests/baselines/reference/operatorsAndIntersectionTypes.types +++ b/tests/baselines/reference/operatorsAndIntersectionTypes.types @@ -110,7 +110,7 @@ const b1 = guid === ""; >b1 : boolean >guid === "" : boolean >guid : string & { $Guid: any; } ->"" : string +>"" : "" const b2 = guid === guid; >b2 : boolean @@ -122,7 +122,7 @@ const b3 = serialNo === 0; >b3 : boolean >serialNo === 0 : boolean >serialNo : number & { $SerialNo: any; } ->0 : number +>0 : 0 const b4 = serialNo === serialNo; >b4 : boolean diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types index 066015389d2..4cf7b0b086f 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types @@ -36,7 +36,7 @@ module Bugs { >args[index] : any >args : any[] >index : any ->'undefined' : string +>'undefined' : "undefined" ? args[index] >args[index] : any diff --git a/tests/baselines/reference/overloadReturnTypes.types b/tests/baselines/reference/overloadReturnTypes.types index 3de1aec1196..e8d1b7905dc 100644 --- a/tests/baselines/reference/overloadReturnTypes.types +++ b/tests/baselines/reference/overloadReturnTypes.types @@ -28,7 +28,7 @@ function attr(nameOrMap: any, value?: string): any { >typeof nameOrMap === "object" : boolean >typeof nameOrMap : string >nameOrMap : any ->"object" : string +>"object" : "object" // handle map case return new Accessor; diff --git a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types index 3d01b876473..37a6d11b598 100644 --- a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types +++ b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types @@ -11,7 +11,7 @@ function foo(x: any) { >x : any case 1: return; ->1 : number +>1 : 1 default: } diff --git a/tests/baselines/reference/recursiveReturns.types b/tests/baselines/reference/recursiveReturns.types index c4d9fd31981..b1fdd125ecc 100644 --- a/tests/baselines/reference/recursiveReturns.types +++ b/tests/baselines/reference/recursiveReturns.types @@ -21,7 +21,7 @@ function R3(n:number) { if (n == 0) { >n == 0 : boolean >n : number ->0 : number +>0 : 0 //return; } diff --git a/tests/baselines/reference/sourceMap-Comments.types b/tests/baselines/reference/sourceMap-Comments.types index cbb58b67994..b1681c05aad 100644 --- a/tests/baselines/reference/sourceMap-Comments.types +++ b/tests/baselines/reference/sourceMap-Comments.types @@ -17,17 +17,17 @@ module sas.tools { >f : number case 1: ->1 : number +>1 : 1 break; case 2: ->2 : number +>2 : 2 //line comment 1 //line comment 2 break; case 3: ->3 : number +>3 : 3 //a comment break; diff --git a/tests/baselines/reference/sourceMapValidationIfElse.types b/tests/baselines/reference/sourceMapValidationIfElse.types index 30de2f11450..2b195983f21 100644 --- a/tests/baselines/reference/sourceMapValidationIfElse.types +++ b/tests/baselines/reference/sourceMapValidationIfElse.types @@ -6,7 +6,7 @@ var i = 10; if (i == 10) { >i == 10 : boolean >i : number ->10 : number +>10 : 10 i++; >i++ : number @@ -18,7 +18,7 @@ if (i == 10) { if (i == 10) >i == 10 : boolean >i : number ->10 : number +>10 : 10 { i++; >i++ : number @@ -27,7 +27,7 @@ if (i == 10) else if (i == 20) { >i == 20 : boolean >i : number ->20 : number +>20 : 20 i--; >i-- : number @@ -36,7 +36,7 @@ else if (i == 20) { } else if (i == 30) { >i == 30 : boolean >i : number ->30 : number +>30 : 30 i += 70; >i += 70 : number diff --git a/tests/baselines/reference/sourceMapValidationSwitch.types b/tests/baselines/reference/sourceMapValidationSwitch.types index a594004a548..1c0a73c1bbe 100644 --- a/tests/baselines/reference/sourceMapValidationSwitch.types +++ b/tests/baselines/reference/sourceMapValidationSwitch.types @@ -7,7 +7,7 @@ switch (x) { >x : number case 5: ->5 : number +>5 : 5 x++; >x++ : number @@ -15,7 +15,7 @@ switch (x) { break; case 10: ->10 : number +>10 : 10 { x--; >x-- : number @@ -35,7 +35,7 @@ switch (x) >x : number { case 5: ->5 : number +>5 : 5 x++; >x++ : number @@ -43,7 +43,7 @@ switch (x) break; case 10: ->10 : number +>10 : 10 { x--; >x-- : number diff --git a/tests/baselines/reference/sourceMapValidationWhile.types b/tests/baselines/reference/sourceMapValidationWhile.types index 9225b93e08c..86cf0216276 100644 --- a/tests/baselines/reference/sourceMapValidationWhile.types +++ b/tests/baselines/reference/sourceMapValidationWhile.types @@ -6,7 +6,7 @@ var a = 10; while (a == 10) { >a == 10 : boolean >a : number ->10 : number +>10 : 10 a++; >a++ : number @@ -15,7 +15,7 @@ while (a == 10) { while (a == 10) >a == 10 : boolean >a : number ->10 : number +>10 : 10 { a++; >a++ : number diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types index 8d35f32707a..7140935cb91 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types @@ -241,7 +241,7 @@ class ListWrapper { >array.length : number >array : T[] >length : number ->0 : number +>0 : 0 >null : null return array[array.length - 1]; @@ -288,7 +288,7 @@ class ListWrapper { >list : T[] >indexOf : (searchElement: T, fromIndex?: number) => number >el : T ->-1 : number +>-1 : -1 >1 : number static reversed(dit: typeof ListWrapper, array: T[]): T[] { @@ -496,7 +496,7 @@ class ListWrapper { >list.length : number >list : any[] >length : number ->0 : number +>0 : 0 static fill(dit: typeof ListWrapper, list: any[], value: any, start: number = 0, end: number = null) { >fill : (dit: typeof ListWrapper, list: any[], value: any, start?: number, end?: number) => void @@ -684,7 +684,7 @@ class ListWrapper { >list.length : number >list : T[] >length : number ->0 : number +>0 : 0 return null; >null : null diff --git a/tests/baselines/reference/stringLiteralCheckedInIf01.types b/tests/baselines/reference/stringLiteralCheckedInIf01.types index 75b7eadbc19..be25df63f20 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf01.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf01.types @@ -16,7 +16,7 @@ function f(foo: T) { if (foo === "a") { >foo === "a" : boolean >foo : ("a" | "b")[] | "a" | "b" ->"a" : string +>"a" : "a" return foo; >foo : ("a" | "b")[] | "a" | "b" @@ -24,7 +24,7 @@ function f(foo: T) { else if (foo === "b") { >foo === "b" : boolean >foo : ("a" | "b")[] | "a" | "b" ->"b" : string +>"b" : "b" return foo; >foo : ("a" | "b")[] | "a" | "b" diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.types b/tests/baselines/reference/stringLiteralCheckedInIf02.types index 79f4c6a223a..ae0e370e33b 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf02.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.types @@ -19,10 +19,10 @@ function isS(t: T): t is S { >t === "a" || t === "b" : boolean >t === "a" : boolean >t : ("a" | "b")[] | "a" | "b" ->"a" : string +>"a" : "a" >t === "b" : boolean >t : ("a" | "b")[] | "a" | "b" ->"b" : string +>"b" : "b" } function f(foo: T) { diff --git a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types index cfbb77e07e0..ded50d120fd 100644 --- a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types +++ b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types @@ -16,10 +16,10 @@ switch (foo) { >foo : ("a" | "b")[] | "a" | "b" case "a": ->"a" : string +>"a" : "a" case "b": ->"b" : string +>"b" : "b" break; default: diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.types b/tests/baselines/reference/stringLiteralTypesAndTuples01.types index e8b5b37a2dd..b15656835b2 100644 --- a/tests/baselines/reference/stringLiteralTypesAndTuples01.types +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.types @@ -38,7 +38,7 @@ function rawr(dino: RexOrRaptor) { if (dino === "t-rex") { >dino === "t-rex" : boolean >dino : "t-rex" | "raptor" ->"t-rex" : string +>"t-rex" : "t-rex" return "ROAAAAR!"; >"ROAAAAR!" : string @@ -46,7 +46,7 @@ function rawr(dino: RexOrRaptor) { if (dino === "raptor") { >dino === "raptor" : boolean >dino : "t-rex" | "raptor" ->"raptor" : string +>"raptor" : "raptor" return "yip yip!"; >"yip yip!" : string diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types index 7201aaa91ca..aac177224b1 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.types @@ -15,7 +15,7 @@ var y: T = undefined; if (x === "foo") { >x === "foo" : boolean >x : "foo" | "bar" | "baz" ->"foo" : string +>"foo" : "foo" let a = x; >a : "foo" | "bar" | "baz" @@ -24,7 +24,7 @@ if (x === "foo") { else if (x !== "bar") { >x !== "bar" : boolean >x : "foo" | "bar" | "baz" ->"bar" : string +>"bar" : "bar" let b = x || y; >b : "foo" | "bar" | "baz" diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types index 242248617e0..7b61b7e26fb 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types @@ -15,7 +15,7 @@ var y: T = undefined; if (x === "foo") { >x === "foo" : boolean >x : string ->"foo" : string +>"foo" : "foo" let a = x; >a : string @@ -24,7 +24,7 @@ if (x === "foo") { else if (x !== "bar") { >x !== "bar" : boolean >x : string ->"bar" : string +>"bar" : "bar" let b = x || y; >b : string diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types index 920f7e1a71c..c877bfffe3c 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.types @@ -14,7 +14,7 @@ var y: T = undefined; if (x === "foo") { >x === "foo" : boolean >x : "foo" | "bar" | number ->"foo" : string +>"foo" : "foo" let a = x; >a : "foo" | "bar" | number @@ -23,7 +23,7 @@ if (x === "foo") { else if (x !== "bar") { >x !== "bar" : boolean >x : "foo" | "bar" | number ->"bar" : string +>"bar" : "bar" let b = x || y; >b : "foo" | "bar" | number diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types index fdaaa21b6cb..eb96d02217e 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types @@ -16,7 +16,7 @@ let y: T = undefined; if (x === "") { >x === "" : boolean >x : "" | "foo" ->"" : string +>"" : "" let a = x; >a : "" | "foo" @@ -26,7 +26,7 @@ if (x === "") { if (x !== "") { >x !== "" : boolean >x : "" | "foo" ->"" : string +>"" : "" let b = x; >b : "" | "foo" @@ -36,7 +36,7 @@ if (x !== "") { if (x == "") { >x == "" : boolean >x : "" | "foo" ->"" : string +>"" : "" let c = x; >c : "" | "foo" @@ -46,7 +46,7 @@ if (x == "") { if (x != "") { >x != "" : boolean >x : "" | "foo" ->"" : string +>"" : "" let d = x; >d : "" | "foo" diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.types b/tests/baselines/reference/stringLiteralTypesOverloads01.types index 6ba8d482117..21c9831e9e7 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.types @@ -39,7 +39,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { if (x === "string") { >x === "string" : boolean >x : "string" | "number" | "boolean" ->"string" : string +>"string" : "string" return ""; >"" : string @@ -47,7 +47,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { if (x === "number") { >x === "number" : boolean >x : "string" | "number" | "boolean" ->"number" : string +>"number" : "number" return 0; >0 : number @@ -55,7 +55,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { if (x === "boolean") { >x === "boolean" : boolean >x : "string" | "number" | "boolean" ->"boolean" : string +>"boolean" : "boolean" return false; >false : boolean diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types index 90cb538b800..46442d75ad4 100644 --- a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types @@ -16,9 +16,9 @@ let abcOrXyz: "ABC" | "XYZ" = abc || xyz; let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; >abcOrXyzOrNumber : "ABC" | "XYZ" | number ->abcOrXyz || 100 : "ABC" | "XYZ" | number +>abcOrXyz || 100 : "ABC" | "XYZ" | 100 >abcOrXyz : "ABC" | "XYZ" ->100 : number +>100 : 100 let a = "" + abc; >a : string diff --git a/tests/baselines/reference/switchBreakStatements.types b/tests/baselines/reference/switchBreakStatements.types index 0364d878d5a..c69c20a3306 100644 --- a/tests/baselines/reference/switchBreakStatements.types +++ b/tests/baselines/reference/switchBreakStatements.types @@ -4,7 +4,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" break; } @@ -16,7 +16,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" break ONE; >ONE : any @@ -32,7 +32,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" break THREE; >THREE : any @@ -45,7 +45,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" FIVE: >FIVE : any @@ -54,7 +54,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" break FOUR; >FOUR : any @@ -65,7 +65,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" SIX: >SIX : any @@ -74,7 +74,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" break SIX; >SIX : any @@ -88,19 +88,19 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" break SEVEN; >SEVEN : any @@ -112,7 +112,7 @@ switch ('') { >'' : string case 'a': ->'a' : string +>'a' : "a" var fn = function () { } >fn : () => void diff --git a/tests/baselines/reference/switchCases.types b/tests/baselines/reference/switchCases.types index 154ea011cde..0f10e702907 100644 --- a/tests/baselines/reference/switchCases.types +++ b/tests/baselines/reference/switchCases.types @@ -3,7 +3,7 @@ switch(0) { >0 : number case 1: ->1 : number +>1 : 1 break; } diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt index 26d39efef48..e430b33097c 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type 'string' is not comparable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'boolean' is not comparable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type '"sss"' is not comparable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'true' is not comparable to type 'number'. ==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (3 errors) ==== @@ -12,11 +12,11 @@ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: T !!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'. case "sss": break; // Error ~~~~~ -!!! error TS2678: Type 'string' is not comparable to type 'number'. +!!! error TS2678: Type '"sss"' is not comparable to type 'number'. case 123: break; // No Error case true: break; // Error ~~~~ -!!! error TS2678: Type 'boolean' is not comparable to type 'number'. +!!! error TS2678: Type 'true' is not comparable to type 'number'. } var s: any = 0; diff --git a/tests/baselines/reference/switchFallThroughs.types b/tests/baselines/reference/switchFallThroughs.types index 7a88985741c..cd0af6693eb 100644 --- a/tests/baselines/reference/switchFallThroughs.types +++ b/tests/baselines/reference/switchFallThroughs.types @@ -7,13 +7,13 @@ function R1(index: number) { >index : number case 0: ->0 : number +>0 : 0 case 1: ->1 : number +>1 : 1 case 2: ->2 : number +>2 : 2 var a = 'a'; >a : string @@ -23,16 +23,16 @@ function R1(index: number) { >a : string case 3: ->3 : number +>3 : 3 case 4: { ->4 : number +>4 : 4 return 'b'; >'b' : string } case 5: ->5 : number +>5 : 5 default: return 'c'; diff --git a/tests/baselines/reference/symbolType17.types b/tests/baselines/reference/symbolType17.types index a6174f7a3ae..c186f915cd0 100644 --- a/tests/baselines/reference/symbolType17.types +++ b/tests/baselines/reference/symbolType17.types @@ -14,7 +14,7 @@ if (typeof x === "symbol") { >typeof x === "symbol" : boolean >typeof x : string >x : symbol | Foo ->"symbol" : string +>"symbol" : "symbol" x; >x : symbol diff --git a/tests/baselines/reference/symbolType18.types b/tests/baselines/reference/symbolType18.types index 68c43215136..8f0012f4f11 100644 --- a/tests/baselines/reference/symbolType18.types +++ b/tests/baselines/reference/symbolType18.types @@ -14,7 +14,7 @@ if (typeof x === "object") { >typeof x === "object" : boolean >typeof x : string >x : symbol | Foo ->"object" : string +>"object" : "object" x; >x : Foo diff --git a/tests/baselines/reference/symbolType19.types b/tests/baselines/reference/symbolType19.types index 33c4f5ac07c..18daa27fd00 100644 --- a/tests/baselines/reference/symbolType19.types +++ b/tests/baselines/reference/symbolType19.types @@ -13,7 +13,7 @@ if (typeof x === "number") { >typeof x === "number" : boolean >typeof x : string >x : symbol | E ->"number" : string +>"number" : "number" x; >x : E diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types index 83a0f2cf9f4..8ebab064029 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types @@ -39,6 +39,6 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >member : new (s: string) => new (n: number) => new () => boolean >"hello" : string >42 : number ->true : boolean +>true : true diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types index c240b7ced11..ec335b81207 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types @@ -39,6 +39,6 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >member : new (s: string) => new (n: number) => new () => boolean >"hello" : string >42 : number ->true : boolean +>true : true diff --git a/tests/baselines/reference/templateStringInEqualityChecks.types b/tests/baselines/reference/templateStringInEqualityChecks.types index 51a450e5245..2f1b2cf987b 100644 --- a/tests/baselines/reference/templateStringInEqualityChecks.types +++ b/tests/baselines/reference/templateStringInEqualityChecks.types @@ -19,11 +19,11 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` == "abc0abc" : boolean >`abc${0}abc` : string >0 : number ->"abc0abc" : string +>"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean ->"abc0abc" : string +>"abc0abc" : "abc0abc" >`abc${0}abc` : string >0 : number diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.types b/tests/baselines/reference/templateStringInEqualityChecksES6.types index 37e5e4a8c28..ce552da09ea 100644 --- a/tests/baselines/reference/templateStringInEqualityChecksES6.types +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.types @@ -19,11 +19,11 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` == "abc0abc" : boolean >`abc${0}abc` : string >0 : number ->"abc0abc" : string +>"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean ->"abc0abc" : string +>"abc0abc" : "abc0abc" >`abc${0}abc` : string >0 : number diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types index c0a43ca38f5..eb127cf28bd 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.types +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -22,7 +22,7 @@ switch (y) { >y : string case 'a': ->'a' : string +>'a' : "a" throw y; >y : string diff --git a/tests/baselines/reference/typeGuardEnums.types b/tests/baselines/reference/typeGuardEnums.types index 2bef6915046..255326e66d2 100644 --- a/tests/baselines/reference/typeGuardEnums.types +++ b/tests/baselines/reference/typeGuardEnums.types @@ -14,7 +14,7 @@ if (typeof x === "number") { >typeof x === "number" : boolean >typeof x : string >x : number | string | E | V ->"number" : string +>"number" : "number" x; // number|E|V >x : number | E | V @@ -28,7 +28,7 @@ if (typeof x !== "number") { >typeof x !== "number" : boolean >typeof x : string >x : number | string ->"number" : string +>"number" : "number" x; // string >x : string diff --git a/tests/baselines/reference/typeGuardIntersectionTypes.types b/tests/baselines/reference/typeGuardIntersectionTypes.types index 8be50453572..6b6dbae8ca2 100644 --- a/tests/baselines/reference/typeGuardIntersectionTypes.types +++ b/tests/baselines/reference/typeGuardIntersectionTypes.types @@ -167,7 +167,7 @@ function hasLegs(x: Beast): x is Legged { return x && typeof x.legs === 'number' >x.legs : number | undefined >x : Beast >legs : number | undefined ->'number' : string +>'number' : "number" function hasWings(x: Beast): x is Winged { return x && !!x.wings; } >hasWings : (x: Beast) => x is Winged @@ -206,7 +206,7 @@ function identifyBeast(beast: Beast) { >beast.legs : number >beast : Legged & Winged >legs : number ->4 : number +>4 : 4 log(`pegasus - 4 legs, wings`); >log(`pegasus - 4 legs, wings`) : void @@ -218,7 +218,7 @@ function identifyBeast(beast: Beast) { >beast.legs : number >beast : Legged & Winged >legs : number ->2 : number +>2 : 2 log(`bird - 2 legs, wings`); >log(`bird - 2 legs, wings`) : void diff --git a/tests/baselines/reference/typeGuardNesting.types b/tests/baselines/reference/typeGuardNesting.types index 2b18e232412..cb06d457a30 100644 --- a/tests/baselines/reference/typeGuardNesting.types +++ b/tests/baselines/reference/typeGuardNesting.types @@ -9,13 +9,13 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >typeof strOrBool === 'boolean' : boolean >typeof strOrBool : string >strOrBool : string | boolean ->'boolean' : string +>'boolean' : "boolean" >!strOrBool : boolean >strOrBool : boolean >typeof strOrBool === 'string' : boolean >typeof strOrBool : string >strOrBool : string | boolean ->'string' : string +>'string' : "string" let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; >label : string @@ -24,7 +24,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >typeof strOrBool === 'string' : boolean >typeof strOrBool : string >strOrBool : boolean | string ->'string' : string +>'string' : "string" >strOrBool : string >"string" : string @@ -35,7 +35,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >typeof strOrBool === 'boolean' : boolean >typeof strOrBool : string >strOrBool : string | boolean ->'boolean' : string +>'boolean' : "boolean" >strOrBool : boolean >false : boolean @@ -46,7 +46,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >typeof strOrBool !== 'boolean' : boolean >typeof strOrBool : string >strOrBool : boolean | string ->'boolean' : string +>'boolean' : "boolean" >strOrBool : string >"string" : string @@ -57,7 +57,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >typeof strOrBool !== 'string' : boolean >typeof strOrBool : string >strOrBool : string | boolean ->'string' : string +>'string' : "string" >strOrBool : boolean >false : boolean } @@ -69,13 +69,13 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >typeof strOrBool !== 'string' : boolean >typeof strOrBool : string >strOrBool : boolean | string ->'string' : string +>'string' : "string" >!strOrBool : boolean >strOrBool : boolean >typeof strOrBool !== 'boolean' : boolean >typeof strOrBool : string >strOrBool : string | boolean ->'boolean' : string +>'boolean' : "boolean" let label: string = (typeof strOrBool === 'string') ? strOrBool : "string"; >label : string @@ -84,7 +84,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >typeof strOrBool === 'string' : boolean >typeof strOrBool : string >strOrBool : boolean | string ->'string' : string +>'string' : "string" >strOrBool : string >"string" : string @@ -95,7 +95,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >typeof strOrBool === 'boolean' : boolean >typeof strOrBool : string >strOrBool : string | boolean ->'boolean' : string +>'boolean' : "boolean" >strOrBool : boolean >false : boolean @@ -106,7 +106,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >typeof strOrBool !== 'boolean' : boolean >typeof strOrBool : string >strOrBool : boolean | string ->'boolean' : string +>'boolean' : "boolean" >strOrBool : string >"string" : string @@ -117,7 +117,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >typeof strOrBool !== 'string' : boolean >typeof strOrBool : string >strOrBool : string | boolean ->'string' : string +>'string' : "string" >strOrBool : boolean >false : boolean } diff --git a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types index a10d398988f..0b1661820d5 100644 --- a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types +++ b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types @@ -44,11 +44,11 @@ if (typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number") { >typeof strOrNumOrBool !== "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" >typeof strOrNumOrBool !== "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : number | boolean ->"number" : string +>"number" : "number" bool = strOrNumOrBool; // boolean >bool = strOrNumOrBool : boolean @@ -68,15 +68,15 @@ if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "numbe >typeof strOrNumOrBoolOrC !== "string" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : string | number | boolean | C ->"string" : string +>"string" : "string" >typeof strOrNumOrBoolOrC !== "number" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : number | boolean | C ->"number" : string +>"number" : "number" >typeof strOrNumOrBoolOrC !== "boolean" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : boolean | C ->"boolean" : string +>"boolean" : "boolean" c = strOrNumOrBoolOrC; // C >c = strOrNumOrBoolOrC : C @@ -96,15 +96,15 @@ if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "numbe >typeof strOrNumOrBoolOrC !== "string" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : C | string | number | boolean ->"string" : string +>"string" : "string" >typeof strOrNumOrBoolOrC !== "number" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : C | number | boolean ->"number" : string +>"number" : "number" >typeof strOrNumOrBool === "boolean" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"boolean" : string +>"boolean" : "boolean" cOrBool = strOrNumOrBoolOrC; // C | boolean >cOrBool = strOrNumOrBoolOrC : C | boolean @@ -132,7 +132,7 @@ if (typeof strOrNumOrBool !== "string" && numOrBool !== strOrNumOrBool) { >typeof strOrNumOrBool !== "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" >numOrBool !== strOrNumOrBool : boolean >numOrBool : number | boolean >strOrNumOrBool : number | boolean diff --git a/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.types b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.types index acd929a7ca1..b576630c1cf 100644 --- a/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.types +++ b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.types @@ -44,11 +44,11 @@ if (typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number") { >typeof strOrNumOrBool === "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" >typeof strOrNumOrBool === "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : number | boolean ->"number" : string +>"number" : "number" strOrNum = strOrNumOrBool; // string | number >strOrNum = strOrNumOrBool : string | number @@ -68,15 +68,15 @@ if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "numbe >typeof strOrNumOrBoolOrC === "string" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : string | number | boolean | C ->"string" : string +>"string" : "string" >typeof strOrNumOrBoolOrC === "number" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : number | boolean | C ->"number" : string +>"number" : "number" >typeof strOrNumOrBoolOrC === "boolean" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : boolean | C ->"boolean" : string +>"boolean" : "boolean" strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean >strOrNumOrBool = strOrNumOrBoolOrC : string | number | boolean @@ -96,15 +96,15 @@ if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "numbe >typeof strOrNumOrBoolOrC === "string" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : string | number | boolean | C ->"string" : string +>"string" : "string" >typeof strOrNumOrBoolOrC === "number" : boolean >typeof strOrNumOrBoolOrC : string >strOrNumOrBoolOrC : number | boolean | C ->"number" : string +>"number" : "number" >typeof strOrNumOrBool !== "boolean" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"boolean" : string +>"boolean" : "boolean" var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C >r1 : string | number | boolean | C @@ -132,7 +132,7 @@ if (typeof strOrNumOrBool === "string" || numOrBool !== strOrNumOrBool) { >typeof strOrNumOrBool === "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" >numOrBool !== strOrNumOrBool : boolean >numOrBool : number | boolean >strOrNumOrBool : number | boolean diff --git a/tests/baselines/reference/typeGuardOfFormNotExpr.types b/tests/baselines/reference/typeGuardOfFormNotExpr.types index e7cfd6a0dce..6989fa663c8 100644 --- a/tests/baselines/reference/typeGuardOfFormNotExpr.types +++ b/tests/baselines/reference/typeGuardOfFormNotExpr.types @@ -28,7 +28,7 @@ if (!(typeof strOrNum === "string")) { >typeof strOrNum === "string" : boolean >typeof strOrNum : string >strOrNum : string | number ->"string" : string +>"string" : "string" num === strOrNum; // number >num === strOrNum : boolean @@ -49,11 +49,11 @@ if (!(typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number")) >typeof strOrNumOrBool === "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" >typeof strOrNumOrBool === "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : number | boolean ->"number" : string +>"number" : "number" bool = strOrNumOrBool; // boolean >bool = strOrNumOrBool : boolean @@ -74,13 +74,13 @@ if (!(typeof strOrNumOrBool !== "string") || !(typeof strOrNumOrBool !== "number >typeof strOrNumOrBool !== "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : boolean | string | number ->"string" : string +>"string" : "string" >!(typeof strOrNumOrBool !== "number") : boolean >(typeof strOrNumOrBool !== "number") : boolean >typeof strOrNumOrBool !== "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : boolean | number ->"number" : string +>"number" : "number" strOrNum = strOrNumOrBool; // string | number >strOrNum = strOrNumOrBool : string | number @@ -101,11 +101,11 @@ if (!(typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number")) >typeof strOrNumOrBool !== "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" >typeof strOrNumOrBool !== "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : number | boolean ->"number" : string +>"number" : "number" strOrNum = strOrNumOrBool; // string | number >strOrNum = strOrNumOrBool : string | number @@ -126,13 +126,13 @@ if (!(typeof strOrNumOrBool === "string") && !(typeof strOrNumOrBool === "number >typeof strOrNumOrBool === "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" >!(typeof strOrNumOrBool === "number") : boolean >(typeof strOrNumOrBool === "number") : boolean >typeof strOrNumOrBool === "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : number | boolean ->"number" : string +>"number" : "number" bool = strOrNumOrBool; // boolean >bool = strOrNumOrBool : boolean @@ -153,7 +153,7 @@ if (!(typeof strOrNumOrBool === "string") && numOrBool !== strOrNumOrBool) { >typeof strOrNumOrBool === "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : boolean | string | number ->"string" : string +>"string" : "string" >numOrBool !== strOrNumOrBool : boolean >numOrBool : number | boolean >strOrNumOrBool : boolean | number diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.types b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.types index 7a4b279b572..9166b00386a 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.types @@ -48,7 +48,7 @@ if (typeof strOrBool === "boolean") { >typeof strOrBool === "boolean" : boolean >typeof strOrBool : string >strOrBool : string | boolean ->"boolean" : string +>"boolean" : "boolean" bool = strOrBool; // boolean >bool = strOrBool : boolean @@ -65,7 +65,7 @@ if (typeof numOrBool === "boolean") { >typeof numOrBool === "boolean" : boolean >typeof numOrBool : string >numOrBool : number | boolean ->"boolean" : string +>"boolean" : "boolean" bool = numOrBool; // boolean >bool = numOrBool : boolean @@ -82,7 +82,7 @@ if (typeof strOrNumOrBool === "boolean") { >typeof strOrNumOrBool === "boolean" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"boolean" : string +>"boolean" : "boolean" bool = strOrNumOrBool; // boolean >bool = strOrNumOrBool : boolean @@ -99,7 +99,7 @@ if (typeof boolOrC === "boolean") { >typeof boolOrC === "boolean" : boolean >typeof boolOrC : string >boolOrC : boolean | C ->"boolean" : string +>"boolean" : "boolean" bool = boolOrC; // boolean >bool = boolOrC : boolean @@ -117,7 +117,7 @@ if (typeof strOrNum === "boolean") { >typeof strOrNum === "boolean" : boolean >typeof strOrNum : string >strOrNum : string | number ->"boolean" : string +>"boolean" : "boolean" let z1: {} = strOrNum; // {} >z1 : {} @@ -137,7 +137,7 @@ if (typeof strOrBool !== "boolean") { >typeof strOrBool !== "boolean" : boolean >typeof strOrBool : string >strOrBool : boolean | string ->"boolean" : string +>"boolean" : "boolean" str = strOrBool; // string >str = strOrBool : string @@ -154,7 +154,7 @@ if (typeof numOrBool !== "boolean") { >typeof numOrBool !== "boolean" : boolean >typeof numOrBool : string >numOrBool : boolean | number ->"boolean" : string +>"boolean" : "boolean" num = numOrBool; // number >num = numOrBool : number @@ -171,7 +171,7 @@ if (typeof strOrNumOrBool !== "boolean") { >typeof strOrNumOrBool !== "boolean" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : boolean | string | number ->"boolean" : string +>"boolean" : "boolean" strOrNum = strOrNumOrBool; // string | number >strOrNum = strOrNumOrBool : string | number @@ -188,7 +188,7 @@ if (typeof boolOrC !== "boolean") { >typeof boolOrC !== "boolean" : boolean >typeof boolOrC : string >boolOrC : boolean | C ->"boolean" : string +>"boolean" : "boolean" c = boolOrC; // C >c = boolOrC : C @@ -206,7 +206,7 @@ if (typeof strOrNum !== "boolean") { >typeof strOrNum !== "boolean" : boolean >typeof strOrNum : string >strOrNum : string | number ->"boolean" : string +>"boolean" : "boolean" let z1: string | number = strOrNum; // string | number >z1 : string | number diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfIsOrderIndependent.types b/tests/baselines/reference/typeGuardOfFormTypeOfIsOrderIndependent.types index 2d91abb9613..43cc37f98e8 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfIsOrderIndependent.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfIsOrderIndependent.types @@ -25,7 +25,7 @@ var func: () => void; if ("string" === typeof strOrNum) { >"string" === typeof strOrNum : boolean ->"string" : string +>"string" : "string" >typeof strOrNum : string >strOrNum : string | number @@ -42,7 +42,7 @@ else { } if ("function" === typeof strOrFunc) { >"function" === typeof strOrFunc : boolean ->"function" : string +>"function" : "function" >typeof strOrFunc : string >strOrFunc : string | (() => void) @@ -59,7 +59,7 @@ else { } if ("number" === typeof numOrBool) { >"number" === typeof numOrBool : boolean ->"number" : string +>"number" : "number" >typeof numOrBool : string >numOrBool : number | boolean @@ -76,7 +76,7 @@ else { } if ("boolean" === typeof strOrBool) { >"boolean" === typeof strOrBool : boolean ->"boolean" : string +>"boolean" : "boolean" >typeof strOrBool : string >strOrBool : string | boolean diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNumber.types b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.types index c6a5615e75a..736cd14e88e 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfNumber.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.types @@ -48,7 +48,7 @@ if (typeof strOrNum === "number") { >typeof strOrNum === "number" : boolean >typeof strOrNum : string >strOrNum : string | number ->"number" : string +>"number" : "number" num = strOrNum; // number >num = strOrNum : number @@ -65,7 +65,7 @@ if (typeof numOrBool === "number") { >typeof numOrBool === "number" : boolean >typeof numOrBool : string >numOrBool : number | boolean ->"number" : string +>"number" : "number" num = numOrBool; // number >num = numOrBool : number @@ -81,7 +81,7 @@ if (typeof strOrNumOrBool === "number") { >typeof strOrNumOrBool === "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"number" : string +>"number" : "number" num = strOrNumOrBool; // number >num = strOrNumOrBool : number @@ -98,7 +98,7 @@ if (typeof numOrC === "number") { >typeof numOrC === "number" : boolean >typeof numOrC : string >numOrC : number | C ->"number" : string +>"number" : "number" num = numOrC; // number >num = numOrC : number @@ -116,7 +116,7 @@ if (typeof strOrBool === "number") { >typeof strOrBool === "number" : boolean >typeof strOrBool : string >strOrBool : string | boolean ->"number" : string +>"number" : "number" let y1: {} = strOrBool; // {} >y1 : {} @@ -135,7 +135,7 @@ if (typeof strOrNum !== "number") { >typeof strOrNum !== "number" : boolean >typeof strOrNum : string >strOrNum : number | string ->"number" : string +>"number" : "number" str === strOrNum; // string >str === strOrNum : boolean @@ -152,7 +152,7 @@ if (typeof numOrBool !== "number") { >typeof numOrBool !== "number" : boolean >typeof numOrBool : string >numOrBool : number | boolean ->"number" : string +>"number" : "number" var x: number | boolean = numOrBool; // number | boolean >x : number | boolean @@ -168,7 +168,7 @@ if (typeof strOrNumOrBool !== "number") { >typeof strOrNumOrBool !== "number" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : number | string | boolean ->"number" : string +>"number" : "number" strOrBool = strOrNumOrBool; // string | boolean >strOrBool = strOrNumOrBool : string | boolean @@ -185,7 +185,7 @@ if (typeof numOrC !== "number") { >typeof numOrC !== "number" : boolean >typeof numOrC : string >numOrC : number | C ->"number" : string +>"number" : "number" c = numOrC; // C >c = numOrC : C @@ -203,7 +203,7 @@ if (typeof strOrBool !== "number") { >typeof strOrBool !== "number" : boolean >typeof strOrBool : string >strOrBool : string | boolean ->"number" : string +>"number" : "number" let y1: string | boolean = strOrBool; // string | boolean >y1 : string | boolean diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.types b/tests/baselines/reference/typeGuardOfFormTypeOfOther.types index 8e42a8e0d8e..3dfb720d880 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfOther.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.types @@ -52,7 +52,7 @@ if (typeof strOrC === "Object") { >typeof strOrC === "Object" : boolean >typeof strOrC : string >strOrC : string | C ->"Object" : string +>"Object" : "Object" c = strOrC; // C >c = strOrC : C @@ -68,7 +68,7 @@ if (typeof numOrC === "Object") { >typeof numOrC === "Object" : boolean >typeof numOrC : string >numOrC : number | C ->"Object" : string +>"Object" : "Object" c = numOrC; // C >c = numOrC : C @@ -84,7 +84,7 @@ if (typeof boolOrC === "Object") { >typeof boolOrC === "Object" : boolean >typeof boolOrC : string >boolOrC : boolean | C ->"Object" : string +>"Object" : "Object" c = boolOrC; // C >c = boolOrC : C @@ -101,7 +101,7 @@ if (typeof strOrNumOrBool === "Object") { >typeof strOrNumOrBool === "Object" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"Object" : string +>"Object" : "Object" let q1: {} = strOrNumOrBool; // {} >q1 : {} @@ -120,7 +120,7 @@ if (typeof strOrC !== "Object") { >typeof strOrC !== "Object" : boolean >typeof strOrC : string >strOrC : C | string ->"Object" : string +>"Object" : "Object" var r2: string = strOrC; // string >r2 : string @@ -136,7 +136,7 @@ if (typeof numOrC !== "Object") { >typeof numOrC !== "Object" : boolean >typeof numOrC : string >numOrC : C | number ->"Object" : string +>"Object" : "Object" var r3: number = numOrC; // number >r3 : number @@ -152,7 +152,7 @@ if (typeof boolOrC !== "Object") { >typeof boolOrC !== "Object" : boolean >typeof boolOrC : string >boolOrC : C | boolean ->"Object" : string +>"Object" : "Object" var r4: boolean = boolOrC; // boolean >r4 : boolean @@ -169,7 +169,7 @@ if (typeof strOrNumOrBool !== "Object") { >typeof strOrNumOrBool !== "Object" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"Object" : string +>"Object" : "Object" let q1: string | number | boolean = strOrNumOrBool; // string | number | boolean >q1 : string | number | boolean diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types index 7e88ca5cb94..6302ef58005 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfPrimitiveSubtype.types @@ -10,7 +10,7 @@ if (typeof a === "number") { >typeof a === "number" : boolean >typeof a : string >a : {} ->"number" : string +>"number" : "number" let c: number = a; >c : number @@ -20,7 +20,7 @@ if (typeof a === "string") { >typeof a === "string" : boolean >typeof a : string >a : {} ->"string" : string +>"string" : "string" let c: string = a; >c : string @@ -30,7 +30,7 @@ if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : {} ->"boolean" : string +>"boolean" : "boolean" let c: boolean = a; >c : boolean @@ -41,7 +41,7 @@ if (typeof b === "number") { >typeof b === "number" : boolean >typeof b : string >b : { toString(): string; } ->"number" : string +>"number" : "number" let c: number = b; >c : number @@ -51,7 +51,7 @@ if (typeof b === "string") { >typeof b === "string" : boolean >typeof b : string >b : { toString(): string; } ->"string" : string +>"string" : "string" let c: string = b; >c : string @@ -61,7 +61,7 @@ if (typeof b === "boolean") { >typeof b === "boolean" : boolean >typeof b : string >b : { toString(): string; } ->"boolean" : string +>"boolean" : "boolean" let c: boolean = b; >c : boolean diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfString.types b/tests/baselines/reference/typeGuardOfFormTypeOfString.types index 971109215f7..e9960ac3019 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfString.types +++ b/tests/baselines/reference/typeGuardOfFormTypeOfString.types @@ -48,7 +48,7 @@ if (typeof strOrNum === "string") { >typeof strOrNum === "string" : boolean >typeof strOrNum : string >strOrNum : string | number ->"string" : string +>"string" : "string" str = strOrNum; // string >str = strOrNum : string @@ -65,7 +65,7 @@ if (typeof strOrBool === "string") { >typeof strOrBool === "string" : boolean >typeof strOrBool : string >strOrBool : string | boolean ->"string" : string +>"string" : "string" str = strOrBool; // string >str = strOrBool : string @@ -82,7 +82,7 @@ if (typeof strOrNumOrBool === "string") { >typeof strOrNumOrBool === "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" str = strOrNumOrBool; // string >str = strOrNumOrBool : string @@ -99,7 +99,7 @@ if (typeof strOrC === "string") { >typeof strOrC === "string" : boolean >typeof strOrC : string >strOrC : string | C ->"string" : string +>"string" : "string" str = strOrC; // string >str = strOrC : string @@ -117,7 +117,7 @@ if (typeof numOrBool === "string") { >typeof numOrBool === "string" : boolean >typeof numOrBool : string >numOrBool : number | boolean ->"string" : string +>"string" : "string" let x1: {} = numOrBool; // {} >x1 : {} @@ -136,7 +136,7 @@ if (typeof strOrNum !== "string") { >typeof strOrNum !== "string" : boolean >typeof strOrNum : string >strOrNum : string | number ->"string" : string +>"string" : "string" num === strOrNum; // number >num === strOrNum : boolean @@ -153,7 +153,7 @@ if (typeof strOrBool !== "string") { >typeof strOrBool !== "string" : boolean >typeof strOrBool : string >strOrBool : string | boolean ->"string" : string +>"string" : "string" bool = strOrBool; // boolean >bool = strOrBool : boolean @@ -170,7 +170,7 @@ if (typeof strOrNumOrBool !== "string") { >typeof strOrNumOrBool !== "string" : boolean >typeof strOrNumOrBool : string >strOrNumOrBool : string | number | boolean ->"string" : string +>"string" : "string" numOrBool = strOrNumOrBool; // number | boolean >numOrBool = strOrNumOrBool : number | boolean @@ -187,7 +187,7 @@ if (typeof strOrC !== "string") { >typeof strOrC !== "string" : boolean >typeof strOrC : string >strOrC : string | C ->"string" : string +>"string" : "string" c = strOrC; // C >c = strOrC : C @@ -205,7 +205,7 @@ if (typeof numOrBool !== "string") { >typeof numOrBool !== "string" : boolean >typeof numOrBool : string >numOrBool : number | boolean ->"string" : string +>"string" : "string" let x1: number | boolean = numOrBool; // number | boolean >x1 : number | boolean diff --git a/tests/baselines/reference/typeGuardRedundancy.types b/tests/baselines/reference/typeGuardRedundancy.types index 754019de7ed..e028b4d11eb 100644 --- a/tests/baselines/reference/typeGuardRedundancy.types +++ b/tests/baselines/reference/typeGuardRedundancy.types @@ -9,11 +9,11 @@ var r1 = typeof x === "string" && typeof x === "string" ? x.substr : x.toFixed; >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" >typeof x === "string" : boolean >typeof x : string >x : string ->"string" : string +>"string" : "string" >x.substr : (from: number, length?: number) => string >x : string >substr : (from: number, length?: number) => string @@ -30,11 +30,11 @@ var r2 = !(typeof x === "string" && typeof x === "string") ? x.toFixed : x.subst >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" >typeof x === "string" : boolean >typeof x : string >x : string ->"string" : string +>"string" : "string" >x.toFixed : (fractionDigits?: number) => string >x : number >toFixed : (fractionDigits?: number) => string @@ -49,11 +49,11 @@ var r3 = typeof x === "string" || typeof x === "string" ? x.substr : x.toFixed; >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >typeof x === "string" : boolean >typeof x : string >x : number ->"string" : string +>"string" : "string" >x.substr : (from: number, length?: number) => string >x : string >substr : (from: number, length?: number) => string @@ -70,11 +70,11 @@ var r4 = !(typeof x === "string" || typeof x === "string") ? x.toFixed : x.subst >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" >typeof x === "string" : boolean >typeof x : string >x : number ->"string" : string +>"string" : "string" >x.toFixed : (fractionDigits?: number) => string >x : number >toFixed : (fractionDigits?: number) => string diff --git a/tests/baselines/reference/typeGuardTautologicalConsistiency.types b/tests/baselines/reference/typeGuardTautologicalConsistiency.types index 8e681deb073..f86a9e66fa2 100644 --- a/tests/baselines/reference/typeGuardTautologicalConsistiency.types +++ b/tests/baselines/reference/typeGuardTautologicalConsistiency.types @@ -6,13 +6,13 @@ if (typeof stringOrNumber === "number") { >typeof stringOrNumber === "number" : boolean >typeof stringOrNumber : string >stringOrNumber : string | number ->"number" : string +>"number" : "number" if (typeof stringOrNumber !== "number") { >typeof stringOrNumber !== "number" : boolean >typeof stringOrNumber : string >stringOrNumber : number ->"number" : string +>"number" : "number" stringOrNumber; >stringOrNumber : string @@ -24,11 +24,11 @@ if (typeof stringOrNumber === "number" && typeof stringOrNumber !== "number") { >typeof stringOrNumber === "number" : boolean >typeof stringOrNumber : string >stringOrNumber : string | number ->"number" : string +>"number" : "number" >typeof stringOrNumber !== "number" : boolean >typeof stringOrNumber : string >stringOrNumber : number ->"number" : string +>"number" : "number" stringOrNumber; >stringOrNumber : string diff --git a/tests/baselines/reference/typeGuardTypeOfUndefined.types b/tests/baselines/reference/typeGuardTypeOfUndefined.types index 167d6204a98..d20eca99ca1 100644 --- a/tests/baselines/reference/typeGuardTypeOfUndefined.types +++ b/tests/baselines/reference/typeGuardTypeOfUndefined.types @@ -8,13 +8,13 @@ function test1(a: any) { >typeof a !== "undefined" : boolean >typeof a : string >a : any ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : any ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -38,13 +38,13 @@ function test2(a: any) { >typeof a === "undefined" : boolean >typeof a : string >a : any ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : undefined ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -69,11 +69,11 @@ function test3(a: any) { >typeof a === "undefined" : boolean >typeof a : string >a : any ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : any ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -93,11 +93,11 @@ function test4(a: any) { >typeof a !== "undefined" : boolean >typeof a : string >a : any ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : any ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -116,13 +116,13 @@ function test5(a: boolean | void) { >typeof a !== "undefined" : boolean >typeof a : string >a : boolean | void ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : boolean ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -146,13 +146,13 @@ function test6(a: boolean | void) { >typeof a === "undefined" : boolean >typeof a : string >a : boolean | void ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : boolean | void ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -177,11 +177,11 @@ function test7(a: boolean | void) { >typeof a === "undefined" : boolean >typeof a : string >a : boolean | void ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : boolean ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean | void @@ -201,11 +201,11 @@ function test8(a: boolean | void) { >typeof a !== "undefined" : boolean >typeof a : string >a : boolean | void ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : boolean ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -224,13 +224,13 @@ function test9(a: boolean | number) { >typeof a !== "undefined" : boolean >typeof a : string >a : boolean | number ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -254,13 +254,13 @@ function test10(a: boolean | number) { >typeof a === "undefined" : boolean >typeof a : string >a : boolean | number ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -285,11 +285,11 @@ function test11(a: boolean | number) { >typeof a === "undefined" : boolean >typeof a : string >a : boolean | number ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean | number @@ -309,11 +309,11 @@ function test12(a: boolean | number) { >typeof a !== "undefined" : boolean >typeof a : string >a : boolean | number ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -332,13 +332,13 @@ function test13(a: boolean | number | void) { >typeof a !== "undefined" : boolean >typeof a : string >a : boolean | number | void ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -362,13 +362,13 @@ function test14(a: boolean | number | void) { >typeof a === "undefined" : boolean >typeof a : string >a : boolean | number | void ->"undefined" : string +>"undefined" : "undefined" if (typeof a === "boolean") { >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number | void ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean @@ -393,11 +393,11 @@ function test15(a: boolean | number | void) { >typeof a === "undefined" : boolean >typeof a : string >a : boolean | number | void ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean | number | void @@ -417,11 +417,11 @@ function test16(a: boolean | number | void) { >typeof a !== "undefined" : boolean >typeof a : string >a : boolean | number | void ->"undefined" : string +>"undefined" : "undefined" >typeof a === "boolean" : boolean >typeof a : string >a : boolean | number ->"boolean" : string +>"boolean" : "boolean" a; >a : boolean diff --git a/tests/baselines/reference/typeGuardsAsAssertions.types b/tests/baselines/reference/typeGuardsAsAssertions.types index 82e92a72d8d..37018c654a8 100644 --- a/tests/baselines/reference/typeGuardsAsAssertions.types +++ b/tests/baselines/reference/typeGuardsAsAssertions.types @@ -120,7 +120,7 @@ function foo1() { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >x.slice() : string >x.slice : (start?: number | undefined, end?: number | undefined) => string >x : string @@ -154,7 +154,7 @@ function foo2() { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" x = x.slice(); >x = x.slice() : string @@ -213,7 +213,7 @@ function f2() { >typeof x === "string" : boolean >typeof x : string >x : undefined ->"string" : string +>"string" : "string" x; // string (guard as assertion) >x : string @@ -256,7 +256,7 @@ function f4() { >typeof x === "boolean" : boolean >typeof x : string >x : undefined ->"boolean" : string +>"boolean" : "boolean" x; // nothing (boolean not in declared type) >x : never @@ -274,11 +274,11 @@ function f5(x: string | number) { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" >typeof x === "number" : boolean >typeof x : string >x : string ->"number" : string +>"number" : "number" x; // number (guard as assertion) >x : number diff --git a/tests/baselines/reference/typeGuardsInClassAccessors.types b/tests/baselines/reference/typeGuardsInClassAccessors.types index bdba5e9c116..2250657e453 100644 --- a/tests/baselines/reference/typeGuardsInClassAccessors.types +++ b/tests/baselines/reference/typeGuardsInClassAccessors.types @@ -28,7 +28,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -44,7 +44,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -65,7 +65,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -78,7 +78,7 @@ class ClassWithAccessors { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -94,7 +94,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -111,7 +111,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -127,7 +127,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -148,7 +148,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -161,7 +161,7 @@ class ClassWithAccessors { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -177,7 +177,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -194,7 +194,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -210,7 +210,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -231,7 +231,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -244,7 +244,7 @@ class ClassWithAccessors { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -260,7 +260,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -277,7 +277,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -293,7 +293,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -314,7 +314,7 @@ class ClassWithAccessors { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -327,7 +327,7 @@ class ClassWithAccessors { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -343,7 +343,7 @@ class ClassWithAccessors { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number diff --git a/tests/baselines/reference/typeGuardsInClassMethods.types b/tests/baselines/reference/typeGuardsInClassMethods.types index b3e20c88ed3..600e3e36ab0 100644 --- a/tests/baselines/reference/typeGuardsInClassMethods.types +++ b/tests/baselines/reference/typeGuardsInClassMethods.types @@ -23,7 +23,7 @@ class C1 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -39,7 +39,7 @@ class C1 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -52,7 +52,7 @@ class C1 { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -70,7 +70,7 @@ class C1 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -86,7 +86,7 @@ class C1 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -99,7 +99,7 @@ class C1 { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -117,7 +117,7 @@ class C1 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -133,7 +133,7 @@ class C1 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -146,7 +146,7 @@ class C1 { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -164,7 +164,7 @@ class C1 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -180,7 +180,7 @@ class C1 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -193,7 +193,7 @@ class C1 { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -211,7 +211,7 @@ class C1 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -227,7 +227,7 @@ class C1 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -240,7 +240,7 @@ class C1 { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number diff --git a/tests/baselines/reference/typeGuardsInConditionalExpression.types b/tests/baselines/reference/typeGuardsInConditionalExpression.types index cc1459738e4..3224dc48b5b 100644 --- a/tests/baselines/reference/typeGuardsInConditionalExpression.types +++ b/tests/baselines/reference/typeGuardsInConditionalExpression.types @@ -15,7 +15,7 @@ function foo(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" ? x.length // string >x.length : number @@ -35,7 +35,7 @@ function foo2(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" ? ((x = "hello") && x) // string >((x = "hello") && x) : string @@ -58,7 +58,7 @@ function foo3(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" ? ((x = 10) && x) // number >((x = 10) && x) : number @@ -81,7 +81,7 @@ function foo4(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" ? x // string >x : string @@ -104,7 +104,7 @@ function foo5(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" ? x // string >x : string @@ -128,7 +128,7 @@ function foo6(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" ? ((x = 10) && x) // number >((x = 10) && x) : number @@ -157,19 +157,19 @@ function foo7(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x === "hello" // boolean >x === "hello" : boolean >x : string ->"hello" : string +>"hello" : "hello" : typeof x === "boolean" >typeof x === "boolean" ? x // boolean : x == 10 : boolean >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x // boolean >x : boolean @@ -177,7 +177,7 @@ function foo7(x: number | string | boolean) { : x == 10; // boolean >x == 10 : boolean >x : number ->10 : number +>10 : 10 } function foo8(x: number | string | boolean) { >foo8 : (x: number | string | boolean) => boolean @@ -191,12 +191,12 @@ function foo8(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x === "hello" >x === "hello" : boolean >x : string ->"hello" : string +>"hello" : "hello" : ((b = x) && // number | boolean >((b = x) && // number | boolean (typeof x === "boolean" ? x // boolean : x == 10)) : boolean @@ -212,7 +212,7 @@ function foo8(x: number | string | boolean) { >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x // boolean >x : boolean @@ -220,7 +220,7 @@ function foo8(x: number | string | boolean) { : x == 10)); // boolean >x == 10 : boolean >x : number ->10 : number +>10 : 10 } function foo9(x: number | string) { >foo9 : (x: number | string) => boolean @@ -236,7 +236,7 @@ function foo9(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" ? ((y = x.length) && x === "hello") // boolean >((y = x.length) && x === "hello") : boolean @@ -249,12 +249,12 @@ function foo9(x: number | string) { >length : number >x === "hello" : boolean >x : string ->"hello" : string +>"hello" : "hello" : x === 10; // boolean >x === 10 : boolean >x : number ->10 : number +>10 : 10 } function foo10(x: number | string | boolean) { >foo10 : (x: number | string | boolean) => string @@ -269,7 +269,7 @@ function foo10(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x // string >x : string @@ -287,7 +287,7 @@ function foo10(x: number | string | boolean) { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" && x.toString()); // x is number >x.toString() : string @@ -308,7 +308,7 @@ function foo11(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x // string >x : string @@ -327,7 +327,7 @@ function foo11(x: number | string | boolean) { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" && (x = 10) // assignment to x >(x = 10) : number @@ -351,7 +351,7 @@ function foo12(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? ((x = 10) && x.toString().length) // number >((x = 10) && x.toString().length) : number @@ -380,7 +380,7 @@ function foo12(x: number | string | boolean) { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" && x); // x is number >x : number diff --git a/tests/baselines/reference/typeGuardsInDoStatement.types b/tests/baselines/reference/typeGuardsInDoStatement.types index 79183e7d6c8..3000764051d 100644 --- a/tests/baselines/reference/typeGuardsInDoStatement.types +++ b/tests/baselines/reference/typeGuardsInDoStatement.types @@ -24,7 +24,7 @@ function a(x: string | number | boolean) { >typeof x === "string" : boolean >typeof x : string >x : string | number | boolean ->"string" : string +>"string" : "string" x; // number | boolean >x : number | boolean @@ -54,7 +54,7 @@ function b(x: string | number | boolean) { >typeof x === "string" : boolean >typeof x : string >x : string | number | boolean ->"string" : string +>"string" : "string" x; // number | boolean >x : number | boolean @@ -84,7 +84,7 @@ function c(x: string | number) { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" x; // string | number >x : string | number diff --git a/tests/baselines/reference/typeGuardsInExternalModule.types b/tests/baselines/reference/typeGuardsInExternalModule.types index 940e7db831a..a0c33af4557 100644 --- a/tests/baselines/reference/typeGuardsInExternalModule.types +++ b/tests/baselines/reference/typeGuardsInExternalModule.types @@ -13,7 +13,7 @@ if (typeof var1 === "string") { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" num = var1.length; // string >num = var1.length : number @@ -40,7 +40,7 @@ if (typeof var2 === "string") { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" // export makes the var property and not variable strOrNum = var2; // string | number diff --git a/tests/baselines/reference/typeGuardsInForStatement.types b/tests/baselines/reference/typeGuardsInForStatement.types index 5ebdea53c31..6a7561bb436 100644 --- a/tests/baselines/reference/typeGuardsInForStatement.types +++ b/tests/baselines/reference/typeGuardsInForStatement.types @@ -13,7 +13,7 @@ function a(x: string | number) { >typeof x !== "number" : boolean >typeof x : string >x : string | number ->"number" : string +>"number" : "number" >x = undefined : undefined >x : string | number >undefined : undefined @@ -35,7 +35,7 @@ function b(x: string | number) { >typeof x !== "number" : boolean >typeof x : string >x : string | number ->"number" : string +>"number" : "number" >x = undefined : undefined >x : string | number >undefined : undefined @@ -60,7 +60,7 @@ function c(x: string | number) { >typeof x !== "number" : boolean >typeof x : string >x : string | number ->"number" : string +>"number" : "number" >x = undefined : undefined >x : string | number >undefined : undefined diff --git a/tests/baselines/reference/typeGuardsInFunction.types b/tests/baselines/reference/typeGuardsInFunction.types index 5ae489ce48a..6a007dd7c95 100644 --- a/tests/baselines/reference/typeGuardsInFunction.types +++ b/tests/baselines/reference/typeGuardsInFunction.types @@ -22,7 +22,7 @@ function f(param: string | number) { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -38,7 +38,7 @@ function f(param: string | number) { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -51,7 +51,7 @@ function f(param: string | number) { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -76,7 +76,7 @@ function f1(param: string | number) { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -89,7 +89,7 @@ function f1(param: string | number) { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -102,7 +102,7 @@ function f1(param: string | number) { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -118,7 +118,7 @@ function f1(param: string | number) { >typeof var3 === "string" : boolean >typeof var3 : string >var3 : string | number ->"string" : string +>"string" : "string" >var3.length : number >var3 : string >length : number @@ -130,7 +130,7 @@ function f1(param: string | number) { >typeof param1 === "string" : boolean >typeof param1 : string >param1 : string | number ->"string" : string +>"string" : "string" >param1.length : number >param1 : string >length : number @@ -160,7 +160,7 @@ function f2(param: string | number) { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -173,7 +173,7 @@ function f2(param: string | number) { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -186,7 +186,7 @@ function f2(param: string | number) { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -202,7 +202,7 @@ function f2(param: string | number) { >typeof var3 === "string" : boolean >typeof var3 : string >var3 : string | number ->"string" : string +>"string" : "string" >var3.length : number >var3 : string >length : number @@ -214,7 +214,7 @@ function f2(param: string | number) { >typeof param1 === "string" : boolean >typeof param1 : string >param1 : string | number ->"string" : string +>"string" : "string" >param1.length : number >param1 : string >length : number @@ -247,7 +247,7 @@ function f3(param: string | number) { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -260,7 +260,7 @@ function f3(param: string | number) { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -273,7 +273,7 @@ function f3(param: string | number) { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -289,7 +289,7 @@ function f3(param: string | number) { >typeof var3 === "string" : boolean >typeof var3 : string >var3 : string | number ->"string" : string +>"string" : "string" >var3.length : number >var3 : string >length : number @@ -301,7 +301,7 @@ function f3(param: string | number) { >typeof param1 === "string" : boolean >typeof param1 : string >param1 : string | number ->"string" : string +>"string" : "string" >param1.length : number >param1 : string >length : number @@ -332,7 +332,7 @@ strOrNum = typeof f4() === "string" && f4(); // string | number >typeof f4() : string >f4() : string | number >f4 : () => string | number ->"string" : string +>"string" : "string" >f4() : string | number >f4 : () => string | number diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types index cc9553b9767..946ac9d71ed 100644 --- a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types @@ -10,7 +10,7 @@ function foo(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x >x : string @@ -29,7 +29,7 @@ function foo(x: number | string | boolean) { >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x.toString() // boolean >x.toString() : string @@ -54,7 +54,7 @@ function foo2(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x >x : string @@ -74,7 +74,7 @@ function foo2(x: number | string | boolean) { >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x.toString() // boolean >x.toString() : string @@ -100,7 +100,7 @@ function foo3(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x >x : string @@ -119,7 +119,7 @@ function foo3(x: number | string | boolean) { >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x.toString() // boolean >x.toString() : string @@ -144,7 +144,7 @@ function foo4(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" ? x >x : string @@ -164,7 +164,7 @@ function foo4(x: number | string | boolean) { >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x.toString() // boolean >x.toString() : string @@ -190,7 +190,7 @@ function foo5(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" var y = x; // string; >y : string @@ -225,7 +225,7 @@ module m { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" y = x // string; >y = x : string @@ -240,7 +240,7 @@ module m { >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x.toString() // boolean >x.toString() : string @@ -277,7 +277,7 @@ module m1 { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" y = x // string; >y = x : string @@ -292,7 +292,7 @@ module m1 { >typeof x === "boolean" : boolean >typeof x : string >x : number | boolean ->"boolean" : string +>"boolean" : "boolean" ? x.toString() // boolean >x.toString() : string diff --git a/tests/baselines/reference/typeGuardsInGlobal.types b/tests/baselines/reference/typeGuardsInGlobal.types index b64c1edcc13..7935c05411e 100644 --- a/tests/baselines/reference/typeGuardsInGlobal.types +++ b/tests/baselines/reference/typeGuardsInGlobal.types @@ -13,7 +13,7 @@ if (typeof var1 === "string") { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" num = var1.length; // string >num = var1.length : number diff --git a/tests/baselines/reference/typeGuardsInModule.types b/tests/baselines/reference/typeGuardsInModule.types index 7d3753037ad..f1efc45a248 100644 --- a/tests/baselines/reference/typeGuardsInModule.types +++ b/tests/baselines/reference/typeGuardsInModule.types @@ -24,7 +24,7 @@ module m1 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -37,7 +37,7 @@ module m1 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" num = var2.length; // string >num = var2.length : number @@ -61,7 +61,7 @@ module m1 { >typeof var3 === "string" : boolean >typeof var3 : string >var3 : string | number ->"string" : string +>"string" : "string" strOrNum = var3; // string | number >strOrNum = var3 : string @@ -96,7 +96,7 @@ module m2 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -109,7 +109,7 @@ module m2 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -122,7 +122,7 @@ module m2 { >typeof var3 === "string" : boolean >typeof var3 : string >var3 : string | number ->"string" : string +>"string" : "string" >var3 : string // variables in module declaration @@ -133,7 +133,7 @@ module m2 { >typeof var4 === "string" : boolean >typeof var4 : string >var4 : string | number ->"string" : string +>"string" : "string" num = var4.length; // string >num = var4.length : number @@ -157,7 +157,7 @@ module m2 { >typeof var5 === "string" : boolean >typeof var5 : string >var5 : string | number ->"string" : string +>"string" : "string" strOrNum = var5; // string | number >strOrNum = var5 : string @@ -185,7 +185,7 @@ module m3.m4 { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -198,7 +198,7 @@ module m3.m4 { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" num = var2.length; // string >num = var2.length : number @@ -222,7 +222,7 @@ module m3.m4 { >typeof var3 === "string" : boolean >typeof var3 : string >var3 : string | number ->"string" : string +>"string" : "string" strOrNum = var3; // string | number >strOrNum = var3 : string diff --git a/tests/baselines/reference/typeGuardsInProperties.types b/tests/baselines/reference/typeGuardsInProperties.types index 4ddf8af7a67..1f8151dff71 100644 --- a/tests/baselines/reference/typeGuardsInProperties.types +++ b/tests/baselines/reference/typeGuardsInProperties.types @@ -37,7 +37,7 @@ class C1 { >this.pp1 : string | number >this : this >pp1 : string | number ->"string" : string +>"string" : "string" >this.pp1 : string >this : this >pp1 : string @@ -51,7 +51,7 @@ class C1 { >this.pp2 : string | number >this : this >pp2 : string | number ->"string" : string +>"string" : "string" >this.pp2 : string >this : this >pp2 : string @@ -65,7 +65,7 @@ class C1 { >this.pp3 : string | number >this : this >pp3 : string | number ->"string" : string +>"string" : "string" >this.pp3 : string >this : this >pp3 : string @@ -84,7 +84,7 @@ strOrNum = typeof c1.pp2 === "string" && c1.pp2; // string | number >c1.pp2 : string | number >c1 : C1 >pp2 : string | number ->"string" : string +>"string" : "string" >c1.pp2 : string >c1 : C1 >pp2 : string @@ -98,7 +98,7 @@ strOrNum = typeof c1.pp3 === "string" && c1.pp3; // string | number >c1.pp3 : string | number >c1 : C1 >pp3 : string | number ->"string" : string +>"string" : "string" >c1.pp3 : string >c1 : C1 >pp3 : string @@ -119,7 +119,7 @@ strOrNum = typeof obj1.x === "string" && obj1.x; // string | number >obj1.x : string | number >obj1 : { x: string | number; } >x : string | number ->"string" : string +>"string" : "string" >obj1.x : string >obj1 : { x: string | number; } >x : string diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types index 2da52b8b1b8..379e26fbb7e 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types +++ b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types @@ -10,12 +10,12 @@ function foo(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >x.length === 10 : boolean >x.length : number >x : string >length : number ->10 : number +>10 : 10 } function foo2(x: number | string) { >foo2 : (x: number | string) => number @@ -27,7 +27,7 @@ function foo2(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >((x = 10) && x) : number >(x = 10) && x : number >(x = 10) : number @@ -46,7 +46,7 @@ function foo3(x: number | string) { >typeof x === "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >((x = "hello") && x) : string >(x = "hello") && x : string >(x = "hello") : string @@ -65,13 +65,13 @@ function foo4(x: number | string | boolean) { >typeof x !== "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" && typeof x !== "number" // number | boolean >typeof x !== "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" && x; // boolean >x : boolean @@ -89,7 +89,7 @@ function foo5(x: number | string | boolean) { >typeof x !== "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" && ((b = x) && (typeof x !== "number" // number | boolean >((b = x) && (typeof x !== "number" // number | boolean && x)) : boolean @@ -103,7 +103,7 @@ function foo5(x: number | string | boolean) { >typeof x !== "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" && x)); // boolean >x : boolean @@ -118,7 +118,7 @@ function foo6(x: number | string | boolean) { >typeof x !== "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" && (typeof x !== "number" // number | boolean >(typeof x !== "number" // number | boolean ? x // boolean : x === 10) : boolean @@ -126,7 +126,7 @@ function foo6(x: number | string | boolean) { >typeof x !== "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" ? x // boolean >x : boolean @@ -134,7 +134,7 @@ function foo6(x: number | string | boolean) { : x === 10) // number >x === 10 : boolean >x : number ->10 : number +>10 : 10 } function foo7(x: number | string | boolean) { >foo7 : (x: number | string | boolean) => string @@ -152,7 +152,7 @@ function foo7(x: number | string | boolean) { >typeof x !== "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" && ((z = x) // number | boolean >((z = x) // number | boolean && (typeof x === "number" // change value of x ? ((x = 10) && x.toString()) // x is number // do not change value : ((y = x) && x.toString()))) : string @@ -168,7 +168,7 @@ function foo7(x: number | string | boolean) { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" // change value of x ? ((x = 10) && x.toString()) // x is number diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types index 659182ab888..b251664e9ee 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types +++ b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types @@ -11,12 +11,12 @@ function foo(x: number | string) { >typeof x !== "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >x.length === 10 : boolean >x.length : number >x : string >length : number ->10 : number +>10 : 10 } function foo2(x: number | string) { >foo2 : (x: number | string) => boolean | number @@ -28,7 +28,7 @@ function foo2(x: number | string) { >typeof x !== "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >((x = 10) || x) : number >(x = 10) || x : number >(x = 10) : number @@ -47,7 +47,7 @@ function foo3(x: number | string) { >typeof x !== "string" : boolean >typeof x : string >x : number | string ->"string" : string +>"string" : "string" >((x = "hello") || x) : string >(x = "hello") || x : string >(x = "hello") : string @@ -66,13 +66,13 @@ function foo4(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" || typeof x === "number" // number | boolean >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" || x; // boolean >x : boolean @@ -90,7 +90,7 @@ function foo5(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" || ((b = x) || (typeof x === "number" // number | boolean >((b = x) || (typeof x === "number" // number | boolean || x)) : number | boolean @@ -104,7 +104,7 @@ function foo5(x: number | string | boolean) { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" || x)); // boolean >x : boolean @@ -119,7 +119,7 @@ function foo6(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" || (typeof x !== "number" // number | boolean >(typeof x !== "number" // number | boolean ? x // boolean : x === 10) : boolean @@ -127,7 +127,7 @@ function foo6(x: number | string | boolean) { >typeof x !== "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" ? x // boolean >x : boolean @@ -135,7 +135,7 @@ function foo6(x: number | string | boolean) { : x === 10) // number >x === 10 : boolean >x : number ->10 : number +>10 : 10 } function foo7(x: number | string | boolean) { >foo7 : (x: number | string | boolean) => boolean | number | string @@ -153,7 +153,7 @@ function foo7(x: number | string | boolean) { >typeof x === "string" : boolean >typeof x : string >x : number | string | boolean ->"string" : string +>"string" : "string" || ((z = x) // number | boolean >((z = x) // number | boolean || (typeof x === "number" // change value of x ? ((x = 10) && x.toString()) // number | boolean | string // do not change value : ((y = x) && x.toString()))) : number | boolean | string @@ -169,7 +169,7 @@ function foo7(x: number | string | boolean) { >typeof x === "number" : boolean >typeof x : string >x : number | boolean ->"number" : string +>"number" : "number" // change value of x ? ((x = 10) && x.toString()) // number | boolean | string diff --git a/tests/baselines/reference/typeGuardsInWhileStatement.types b/tests/baselines/reference/typeGuardsInWhileStatement.types index cde045cc621..1786871f814 100644 --- a/tests/baselines/reference/typeGuardsInWhileStatement.types +++ b/tests/baselines/reference/typeGuardsInWhileStatement.types @@ -10,7 +10,7 @@ function a(x: string | number) { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" x; // string >x : string @@ -31,7 +31,7 @@ function b(x: string | number) { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" if (cond) continue; >cond : boolean @@ -55,7 +55,7 @@ function c(x: string | number) { >typeof x === "string" : boolean >typeof x : string >x : string | number ->"string" : string +>"string" : "string" if (cond) break; >cond : boolean diff --git a/tests/baselines/reference/typeGuardsNestedAssignments.types b/tests/baselines/reference/typeGuardsNestedAssignments.types index 566a39a9c23..3b125d4f32c 100644 --- a/tests/baselines/reference/typeGuardsNestedAssignments.types +++ b/tests/baselines/reference/typeGuardsNestedAssignments.types @@ -109,7 +109,7 @@ function f4() { >x : string | number | null >getStringOrNumberOrNull() : string | number | null >getStringOrNumberOrNull : () => string | number | null ->"number" : string +>"number" : "number" x; >x : number diff --git a/tests/baselines/reference/typeGuardsObjectMethods.types b/tests/baselines/reference/typeGuardsObjectMethods.types index f409bf5caf9..5a795c336e2 100644 --- a/tests/baselines/reference/typeGuardsObjectMethods.types +++ b/tests/baselines/reference/typeGuardsObjectMethods.types @@ -30,7 +30,7 @@ var obj1 = { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -46,7 +46,7 @@ var obj1 = { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -59,7 +59,7 @@ var obj1 = { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -79,7 +79,7 @@ var obj1 = { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -95,7 +95,7 @@ var obj1 = { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -116,7 +116,7 @@ var obj1 = { >typeof var1 === "string" : boolean >typeof var1 : string >var1 : string | number ->"string" : string +>"string" : "string" >var1.length : number >var1 : string >length : number @@ -132,7 +132,7 @@ var obj1 = { >typeof var2 === "string" : boolean >typeof var2 : string >var2 : string | number ->"string" : string +>"string" : "string" >var2.length : number >var2 : string >length : number @@ -145,7 +145,7 @@ var obj1 = { >typeof param === "string" : boolean >typeof param : string >param : string | number ->"string" : string +>"string" : "string" >param.length : number >param : string >length : number @@ -163,7 +163,7 @@ strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum); >obj1 : { method(param: string | number): string | number; prop: string | number; } >method : (param: string | number) => string | number >strOrNum : string | number ->"string" : string +>"string" : "string" >obj1.method(strOrNum) : string | number >obj1.method : (param: string | number) => string | number >obj1 : { method(param: string | number): string | number; prop: string | number; } @@ -180,7 +180,7 @@ strOrNum = typeof obj1.prop === "string" && obj1.prop; >obj1.prop : string | number >obj1 : { method(param: string | number): string | number; prop: string | number; } >prop : string | number ->"string" : string +>"string" : "string" >obj1.prop : string >obj1 : { method(param: string | number): string | number; prop: string | number; } >prop : string diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.types b/tests/baselines/reference/typeGuardsOnClassProperty.types index 6d524ccf674..b4ca9c0b122 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.types +++ b/tests/baselines/reference/typeGuardsOnClassProperty.types @@ -24,7 +24,7 @@ class D { >typeof data === "string" : boolean >typeof data : string >data : string | string[] ->"string" : string +>"string" : "string" >data : string >data.join(" ") : string >data.join : (separator?: string) => string @@ -43,7 +43,7 @@ class D { >this.data : string | string[] >this : this >data : string | string[] ->"string" : string +>"string" : "string" >this.data : string >this : this >data : string @@ -85,7 +85,7 @@ if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} >o.prop1 : number | string >o : { prop1: number | string; prop2: boolean | string; } >prop1 : number | string ->"string" : string +>"string" : "string" >o.prop1.toLowerCase() : string >o.prop1.toLowerCase : () => string >o.prop1 : string @@ -104,7 +104,7 @@ if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { } >typeof prop1 === "string" : boolean >typeof prop1 : string >prop1 : number | string ->"string" : string +>"string" : "string" >prop1.toLocaleLowerCase() : string >prop1.toLocaleLowerCase : () => string >prop1 : string diff --git a/tests/baselines/reference/uncaughtCompilerError1.types b/tests/baselines/reference/uncaughtCompilerError1.types index 20a3f0fbedd..83503195f71 100644 --- a/tests/baselines/reference/uncaughtCompilerError1.types +++ b/tests/baselines/reference/uncaughtCompilerError1.types @@ -19,7 +19,7 @@ function f() { >lineTokens : any >index : any >trim : any ->'=' : string +>'=' : "=" >index > 0 : boolean >index : any >0 : number @@ -27,7 +27,7 @@ function f() { >token.type : any >token : any >type : any ->'' : string +>'' : "" >tokens[index - 1].type === 'attribute.name.html' : boolean >tokens[index - 1].type : any >tokens[index - 1] : any @@ -36,7 +36,7 @@ function f() { >index : any >1 : number >type : any ->'attribute.name.html' : string +>'attribute.name.html' : "attribute.name.html" if (index === (tokens.length - 1)) { >index === (tokens.length - 1) : boolean @@ -65,7 +65,7 @@ function f() { >index : any >1 : number >type : any ->'attribute.value.html' : string +>'attribute.value.html' : "attribute.value.html" >tokens[index + 1].type !== '' : boolean >tokens[index + 1].type : any >tokens[index + 1] : any @@ -74,7 +74,7 @@ function f() { >index : any >1 : number >type : any ->'' : string +>'' : "" return { appendText: '\"\"', advanceCount: 1 }; >{ appendText: '\"\"', advanceCount: 1 } : { appendText: string; advanceCount: number; } diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index 37f3bdb12ab..fcb329193f2 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -149,7 +149,7 @@ var even = _.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >num % 2 : number >num : number >2 : number ->0 : number +>0 : 0 var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >evens : number[] @@ -170,7 +170,7 @@ var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >num % 2 : number >num : number >2 : number ->0 : number +>0 : 0 var listOfPlays = [{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { title: "The Tempest", author: "Shakespeare", year: 1611 }, { title: "Other", author: "Not Shakespeare", year: 2012 }]; >listOfPlays : { title: string; author: string; year: number; }[] @@ -228,7 +228,7 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >num % 2 : number >num : number >2 : number ->0 : number +>0 : 0 _.all([true, 1, null, 'yes'], _.identity); >_.all([true, 1, null, 'yes'], _.identity) : boolean @@ -425,7 +425,7 @@ _.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd'); >num % 2 : number >num : number >2 : number ->0 : number +>0 : 0 >'even' : string >'odd' : string @@ -1249,7 +1249,7 @@ _.chain([1, 2, 3, 200]) >num % 2 : number >num : number >2 : number ->0 : number +>0 : 0 .tap(alert) >tap : (interceptor: (object: number[]) => void) => Underscore.ChainedArray diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types index 58aa450c813..ff204cfdac9 100644 --- a/tests/baselines/reference/unionTypeInference.types +++ b/tests/baselines/reference/unionTypeInference.types @@ -94,11 +94,11 @@ function h(x: string|boolean|T): T { >typeof x === "string" : boolean >typeof x : string >x : string | boolean | T ->"string" : string +>"string" : "string" >typeof x === "boolean" : boolean >typeof x : string >x : boolean | T ->"boolean" : string +>"boolean" : "boolean" >undefined : undefined >x : T } diff --git a/tests/baselines/reference/voidAsOperator.types b/tests/baselines/reference/voidAsOperator.types index 8f2a2951fca..0394e767fd9 100644 --- a/tests/baselines/reference/voidAsOperator.types +++ b/tests/baselines/reference/voidAsOperator.types @@ -4,7 +4,7 @@ if (!void 0 !== true) { >!void 0 : boolean >void 0 : undefined >0 : number ->true : boolean +>true : true } @@ -13,7 +13,7 @@ if (!null !== true) { >!null !== true : boolean >!null : boolean >null : null ->true : boolean +>true : true }