From 320dc7e8cfad0f41629f2a523c070f3b360baf2c Mon Sep 17 00:00:00 2001 From: Tycho Grouwstra Date: Sun, 17 Sep 2017 11:34:38 +0800 Subject: [PATCH] resolve type variables in equality checks --- src/compiler/checker.ts | 12 + .../reference/capturedLetConstInLoop5.types | 162 +++--- .../capturedLetConstInLoop5_ES6.symbols | 515 +++++++++--------- .../capturedLetConstInLoop5_ES6.types | 163 +++--- .../reference/capturedLetConstInLoop6.types | 170 +++--- .../capturedLetConstInLoop6_ES6.types | 170 +++--- .../reference/capturedLetConstInLoop7.types | 202 +++---- .../capturedLetConstInLoop7_ES6.types | 202 +++---- .../reference/capturedLetConstInLoop8.types | 88 +-- .../capturedLetConstInLoop8_ES6.types | 88 +-- ...WithNoRelationshipTypeParameter.errors.txt | 378 ++----------- ...arisonOperatorWithTypeParameter.errors.txt | 158 ++---- .../comparisonOperatorWithTypeParameter.js | 65 ++- .../discriminatedUnionTypes1.symbols | 402 ++++++++++++++ .../reference/discriminatedUnionTypes1.types | 465 ++++++++++++++++ ...stringLiteralsWithEqualityChecks01.symbols | 75 +++ .../stringLiteralsWithEqualityChecks01.types | 123 +++++ ...stringLiteralsWithEqualityChecks02.symbols | 75 +++ .../stringLiteralsWithEqualityChecks02.types | 123 +++++ ...stringLiteralsWithEqualityChecks03.symbols | 90 +++ .../stringLiteralsWithEqualityChecks03.types | 138 +++++ ...stringLiteralsWithEqualityChecks04.symbols | 90 +++ .../stringLiteralsWithEqualityChecks04.types | 138 +++++ ...ringLiteralsWithSwitchStatements02.symbols | 43 ++ ...stringLiteralsWithSwitchStatements02.types | 67 +++ .../comparisonOperatorWithTypeParameter.ts | 35 +- 26 files changed, 2911 insertions(+), 1326 deletions(-) create mode 100644 tests/baselines/reference/discriminatedUnionTypes1.symbols create mode 100644 tests/baselines/reference/discriminatedUnionTypes1.types create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks01.symbols create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks01.types create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks02.symbols create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks02.types create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks03.symbols create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks03.types create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks04.symbols create mode 100644 tests/baselines/reference/stringLiteralsWithEqualityChecks04.types create mode 100644 tests/baselines/reference/stringLiteralsWithSwitchStatements02.symbols create mode 100644 tests/baselines/reference/stringLiteralsWithSwitchStatements02.types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d671d0e558ccb..68447c65108b5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17630,6 +17630,12 @@ namespace ts { if (checkForDisallowedESSymbolOperand(operator)) { leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); + if (leftType.flags & TypeFlags.TypeVariable || leftType.flags & TypeFlags.Intersection) { + leftType = getApparentType(leftType); + } + if (rightType.flags & TypeFlags.TypeVariable || rightType.flags & TypeFlags.Intersection) { + rightType = getApparentType(rightType); + } if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) { reportOperatorError(); } @@ -17645,6 +17651,12 @@ namespace ts { leftType = leftIsLiteral ? getBaseTypeOfLiteralType(leftType) : leftType; rightType = rightIsLiteral ? getBaseTypeOfLiteralType(rightType) : rightType; } + if (leftType.flags & TypeFlags.TypeVariable || leftType.flags & TypeFlags.Intersection) { + leftType = getApparentType(leftType); + } + if (rightType.flags & TypeFlags.TypeVariable || rightType.flags & TypeFlags.Intersection) { + rightType = getApparentType(rightType); + } if (!isTypeEqualityComparableTo(leftType, rightType) && !isTypeEqualityComparableTo(rightType, leftType)) { reportOperatorError(); } diff --git a/tests/baselines/reference/capturedLetConstInLoop5.types b/tests/baselines/reference/capturedLetConstInLoop5.types index 098a1ce70a474..3ec96ca37daf4 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5.types +++ b/tests/baselines/reference/capturedLetConstInLoop5.types @@ -92,10 +92,10 @@ function foo1(x) { for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -143,7 +143,7 @@ function foo2(x) { let x = 1; >x : number ->1 : number +>1 : 1 var v = x; >v : number @@ -227,10 +227,10 @@ function foo4(x) { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number @@ -240,7 +240,7 @@ function foo4(x) { let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + v }); >(function() { return x + v }) : () => number @@ -277,12 +277,12 @@ function foo5(x) { for (let x = 0, y = 1; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >y : number ->1 : number +>1 : 1 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -430,16 +430,16 @@ function foo8(x) { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 var v = x; >v : number @@ -566,33 +566,33 @@ function foo1_c(x) { >x : any for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 var v = x; >v : number ->x : number +>x : 0 (function() { return x + v }); >(function() { return x + v }) : () => number >function() { return x + v } : () => number >x + v : number ->x : number +>x : 0 >v : number (() => x + v); >(() => x + v) : () => number >() => x + v : () => number >x + v : number ->x : number +>x : 0 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 return; @@ -615,30 +615,30 @@ function foo2_c(x) { >1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + v }); >(function() { return x + v }) : () => number >function() { return x + v } : () => number >x + v : number ->x : number +>x : 1 >v : number (() => x + v); >(() => x + v) : () => number >() => x + v : () => number >x + v : number ->x : number +>x : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -657,8 +657,8 @@ function foo3_c(x) { do { const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 var v; >v : any @@ -667,19 +667,19 @@ function foo3_c(x) { >(function() { return x + v }) : () => any >function() { return x + v } : () => any >x + v : any ->x : number +>x : 1 >v : any (() => x + v); >(() => x + v) : () => any >() => x + v : () => any >x + v : any ->x : number +>x : 1 >v : any if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -700,19 +700,19 @@ function foo4_c(x) { >x : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 var v = y; >v : number ->y : number +>y : 0 let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + v }); >(function() { return x + v }) : () => number @@ -748,25 +748,25 @@ function foo5_c(x) { >x : any for (const x = 0, y = 1; x < 1;) { ->x : number ->0 : number ->y : number ->1 : number +>x : 0 +>0 : 0 +>y : 1 +>1 : 1 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 var v = x; >v : number ->x : number +>x : 0 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 >v : number (() => x + y + v); @@ -774,13 +774,13 @@ function foo5_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 return; @@ -804,22 +804,22 @@ function foo6_c(x) { >1 : 1 const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number (() => x + y + v); @@ -827,13 +827,13 @@ function foo6_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -852,22 +852,22 @@ function foo7_c(x) { do { const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number (() => x + y + v); @@ -875,13 +875,13 @@ function foo7_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -903,27 +903,27 @@ function foo8_c(x) { >x : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 >v : number (() => x + y + v); @@ -931,13 +931,13 @@ function foo8_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols b/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols index 5b40cb4459958..7e3d9a07422b3 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.symbols @@ -1,31 +1,30 @@ === tests/cases/compiler/capturedLetConstInLoop5_ES6.ts === - declare function use(a: any); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->a : Symbol(a, Decl(capturedLetConstInLoop5_ES6.ts, 1, 21)) +>a : Symbol(a, Decl(capturedLetConstInLoop5_ES6.ts, 0, 21)) //====let function foo0(x) { ->foo0 : Symbol(foo0, Decl(capturedLetConstInLoop5_ES6.ts, 1, 29)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 14)) +>foo0 : Symbol(foo0, Decl(capturedLetConstInLoop5_ES6.ts, 0, 29)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 3, 14)) for (let x of []) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 12)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 5, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 12)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 5, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 5, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 5, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 4, 12)) return; } @@ -33,30 +32,30 @@ function foo0(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 6, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 5, 11)) } function foo00(x) { ->foo00 : Symbol(foo00, Decl(capturedLetConstInLoop5_ES6.ts, 15, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 15)) +>foo00 : Symbol(foo00, Decl(capturedLetConstInLoop5_ES6.ts, 14, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 16, 15)) for (let x in []) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 12)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 18, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 12)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 18, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 18, 11)) if (x == "1") { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 18, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 17, 12)) return; } @@ -64,32 +63,32 @@ function foo00(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 19, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 18, 11)) } function foo1(x) { ->foo1 : Symbol(foo1, Decl(capturedLetConstInLoop5_ES6.ts, 28, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 14)) +>foo1 : Symbol(foo1, Decl(capturedLetConstInLoop5_ES6.ts, 27, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 29, 14)) for (let x = 0; x < 1; ++x) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 12)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 31, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 12)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 31, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 31, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 31, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 30, 12)) return; } @@ -97,31 +96,31 @@ function foo1(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 32, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 31, 11)) } function foo2(x) { ->foo2 : Symbol(foo2, Decl(capturedLetConstInLoop5_ES6.ts, 41, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 43, 14)) +>foo2 : Symbol(foo2, Decl(capturedLetConstInLoop5_ES6.ts, 40, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 42, 14)) while (1 === 1) { let x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 44, 11)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 44, 11)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 44, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 44, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 44, 11)) return; } @@ -129,30 +128,30 @@ function foo2(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 46, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 45, 11)) } function foo3(x) { ->foo3 : Symbol(foo3, Decl(capturedLetConstInLoop5_ES6.ts, 55, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 57, 14)) +>foo3 : Symbol(foo3, Decl(capturedLetConstInLoop5_ES6.ts, 54, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 56, 14)) do { let x; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 58, 11)) var v; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 58, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 58, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 58, 11)) return; } @@ -160,35 +159,35 @@ function foo3(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 60, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 59, 11)) } function foo4(x) { ->foo4 : Symbol(foo4, Decl(capturedLetConstInLoop5_ES6.ts, 69, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 71, 14)) +>foo4 : Symbol(foo4, Decl(capturedLetConstInLoop5_ES6.ts, 68, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 70, 14)) for (let y = 0; y < 1; ++y) { ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 71, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 71, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 71, 12)) var v = y; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 72, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 72, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 71, 12)) let x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 72, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 72, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 74, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) return; } @@ -196,35 +195,35 @@ function foo4(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 73, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 72, 11)) } function foo5(x) { ->foo5 : Symbol(foo5, Decl(capturedLetConstInLoop5_ES6.ts, 83, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 14)) +>foo5 : Symbol(foo5, Decl(capturedLetConstInLoop5_ES6.ts, 82, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 84, 14)) for (let x = 0, y = 1; x < 1; ++x) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 85, 19)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 12)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 86, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 12)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 85, 19)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 86, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 86, 19)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 85, 19)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 86, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 86, 12)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 85, 12)) return; } @@ -232,35 +231,35 @@ function foo5(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 87, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 86, 11)) } function foo6(x) { ->foo6 : Symbol(foo6, Decl(capturedLetConstInLoop5_ES6.ts, 96, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 99, 14)) +>foo6 : Symbol(foo6, Decl(capturedLetConstInLoop5_ES6.ts, 95, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 98, 14)) while (1 === 1) { let x, y; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 100, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 100, 14)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 100, 11)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 100, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 100, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 101, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 100, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 100, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 100, 11)) return; } @@ -268,34 +267,34 @@ function foo6(x) { use(v) >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 102, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 101, 11)) } function foo7(x) { ->foo7 : Symbol(foo7, Decl(capturedLetConstInLoop5_ES6.ts, 111, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 113, 14)) +>foo7 : Symbol(foo7, Decl(capturedLetConstInLoop5_ES6.ts, 110, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 112, 14)) do { let x, y; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 114, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 114, 14)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 114, 11)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 114, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 114, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 115, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 114, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 114, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 114, 11)) return; } @@ -303,38 +302,38 @@ function foo7(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 116, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 115, 11)) } function foo8(x) { ->foo8 : Symbol(foo8, Decl(capturedLetConstInLoop5_ES6.ts, 125, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 128, 14)) +>foo8 : Symbol(foo8, Decl(capturedLetConstInLoop5_ES6.ts, 124, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 127, 14)) for (let y = 0; y < 1; ++y) { ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 128, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 128, 12)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 128, 12)) let x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 129, 11)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 129, 11)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 129, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 128, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 129, 12)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 129, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 128, 12)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 129, 11)) return; } @@ -342,31 +341,31 @@ function foo8(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 131, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 130, 11)) } //====const function foo0_c(x) { ->foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop5_ES6.ts, 140, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 16)) +>foo0_c : Symbol(foo0_c, Decl(capturedLetConstInLoop5_ES6.ts, 139, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 142, 16)) for (const x of []) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 14)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 144, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 14)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 144, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 144, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 144, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 143, 14)) return; } @@ -374,30 +373,30 @@ function foo0_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 145, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 144, 11)) } function foo00_c(x) { ->foo00_c : Symbol(foo00_c, Decl(capturedLetConstInLoop5_ES6.ts, 154, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 17)) +>foo00_c : Symbol(foo00_c, Decl(capturedLetConstInLoop5_ES6.ts, 153, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 155, 17)) for (const x in []) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 14)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 157, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 14)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 157, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 157, 11)) if (x == "1") { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 157, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 156, 14)) return; } @@ -405,31 +404,31 @@ function foo00_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 158, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 157, 11)) } function foo1_c(x) { ->foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop5_ES6.ts, 167, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 16)) +>foo1_c : Symbol(foo1_c, Decl(capturedLetConstInLoop5_ES6.ts, 166, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 168, 16)) for (const x = 0; x < 1;) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 14)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 170, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 14)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 170, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 170, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 170, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 169, 14)) return; } @@ -437,31 +436,31 @@ function foo1_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 171, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 170, 11)) } function foo2_c(x) { ->foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop5_ES6.ts, 180, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 182, 16)) +>foo2_c : Symbol(foo2_c, Decl(capturedLetConstInLoop5_ES6.ts, 179, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 181, 16)) while (1 === 1) { const x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 183, 13)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 184, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 183, 13)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 183, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 184, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 183, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 184, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 184, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 183, 13)) return; } @@ -469,30 +468,30 @@ function foo2_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 185, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 184, 11)) } function foo3_c(x) { ->foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop5_ES6.ts, 194, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 196, 16)) +>foo3_c : Symbol(foo3_c, Decl(capturedLetConstInLoop5_ES6.ts, 193, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 195, 16)) do { const x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 197, 13)) var v; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 198, 11)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 197, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 198, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 197, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 198, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 198, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 197, 13)) return; } @@ -500,34 +499,34 @@ function foo3_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 199, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 198, 11)) } function foo4_c(x) { ->foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop5_ES6.ts, 208, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 210, 16)) +>foo4_c : Symbol(foo4_c, Decl(capturedLetConstInLoop5_ES6.ts, 207, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 209, 16)) for (const y = 0; y < 1;) { ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 210, 14)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 210, 14)) var v = y; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 211, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 211, 11)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 210, 14)) let x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) (function() { return x + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 211, 11)) (() => x + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 211, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 213, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) return; } @@ -535,34 +534,34 @@ function foo4_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 212, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 211, 11)) } function foo5_c(x) { ->foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop5_ES6.ts, 222, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 16)) +>foo5_c : Symbol(foo5_c, Decl(capturedLetConstInLoop5_ES6.ts, 221, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 223, 16)) for (const x = 0, y = 1; x < 1;) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 14)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 224, 21)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 14)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 225, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 14)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 14)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 224, 21)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 225, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 225, 21)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 14)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 224, 21)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 225, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 225, 14)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 224, 14)) return; } @@ -570,35 +569,35 @@ function foo5_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 226, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 225, 11)) } function foo6_c(x) { ->foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop5_ES6.ts, 235, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 238, 16)) +>foo6_c : Symbol(foo6_c, Decl(capturedLetConstInLoop5_ES6.ts, 234, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 237, 16)) while (1 === 1) { const x = 1, y = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 239, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 239, 20)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 240, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 239, 13)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 239, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 239, 20)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 240, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 240, 20)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 239, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 239, 20)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 240, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 240, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 239, 13)) return; } @@ -606,34 +605,34 @@ function foo6_c(x) { use(v) >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 241, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 240, 11)) } function foo7_c(x) { ->foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop5_ES6.ts, 250, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 252, 16)) +>foo7_c : Symbol(foo7_c, Decl(capturedLetConstInLoop5_ES6.ts, 249, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 251, 16)) do { const x = 1, y = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 253, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 253, 20)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 254, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 253, 13)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 253, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 253, 20)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 254, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 254, 20)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 253, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 253, 20)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 254, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 254, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 253, 13)) return; } @@ -641,37 +640,37 @@ function foo7_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 255, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 254, 11)) } function foo8_c(x) { ->foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop5_ES6.ts, 264, 1)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 267, 16)) +>foo8_c : Symbol(foo8_c, Decl(capturedLetConstInLoop5_ES6.ts, 263, 1)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 266, 16)) for (const y = 0; y < 1;) { ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 267, 14)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 267, 14)) const x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 268, 13)) var v = x; ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11)) ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 269, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 268, 13)) (function() { return x + y + v }); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 268, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 267, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 269, 11)) (() => x + y + v); ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13)) ->y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 268, 14)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 268, 13)) +>y : Symbol(y, Decl(capturedLetConstInLoop5_ES6.ts, 267, 14)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 269, 11)) if (x == 1) { ->x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 269, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop5_ES6.ts, 268, 13)) return; } @@ -679,5 +678,5 @@ function foo8_c(x) { use(v); >use : Symbol(use, Decl(capturedLetConstInLoop5_ES6.ts, 0, 0)) ->v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 270, 11)) +>v : Symbol(v, Decl(capturedLetConstInLoop5_ES6.ts, 269, 11)) } diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.types b/tests/baselines/reference/capturedLetConstInLoop5_ES6.types index 78b41d7cdf354..0a59687ebb308 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.types @@ -1,5 +1,4 @@ === tests/cases/compiler/capturedLetConstInLoop5_ES6.ts === - declare function use(a: any); >use : (a: any) => any >a : any @@ -93,10 +92,10 @@ function foo1(x) { for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -144,7 +143,7 @@ function foo2(x) { let x = 1; >x : number ->1 : number +>1 : 1 var v = x; >v : number @@ -228,10 +227,10 @@ function foo4(x) { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number @@ -241,7 +240,7 @@ function foo4(x) { let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + v }); >(function() { return x + v }) : () => number @@ -278,12 +277,12 @@ function foo5(x) { for (let x = 0, y = 1; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >y : number ->1 : number +>1 : 1 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -431,16 +430,16 @@ function foo8(x) { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 var v = x; >v : number @@ -567,33 +566,33 @@ function foo1_c(x) { >x : any for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 var v = x; >v : number ->x : number +>x : 0 (function() { return x + v }); >(function() { return x + v }) : () => number >function() { return x + v } : () => number >x + v : number ->x : number +>x : 0 >v : number (() => x + v); >(() => x + v) : () => number >() => x + v : () => number >x + v : number ->x : number +>x : 0 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 return; @@ -616,30 +615,30 @@ function foo2_c(x) { >1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + v }); >(function() { return x + v }) : () => number >function() { return x + v } : () => number >x + v : number ->x : number +>x : 1 >v : number (() => x + v); >(() => x + v) : () => number >() => x + v : () => number >x + v : number ->x : number +>x : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -658,8 +657,8 @@ function foo3_c(x) { do { const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 var v; >v : any @@ -668,19 +667,19 @@ function foo3_c(x) { >(function() { return x + v }) : () => any >function() { return x + v } : () => any >x + v : any ->x : number +>x : 1 >v : any (() => x + v); >(() => x + v) : () => any >() => x + v : () => any >x + v : any ->x : number +>x : 1 >v : any if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -701,19 +700,19 @@ function foo4_c(x) { >x : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 var v = y; >v : number ->y : number +>y : 0 let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + v }); >(function() { return x + v }) : () => number @@ -749,25 +748,25 @@ function foo5_c(x) { >x : any for (const x = 0, y = 1; x < 1;) { ->x : number ->0 : number ->y : number ->1 : number +>x : 0 +>0 : 0 +>y : 1 +>1 : 1 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 var v = x; >v : number ->x : number +>x : 0 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 >v : number (() => x + y + v); @@ -775,13 +774,13 @@ function foo5_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 return; @@ -805,22 +804,22 @@ function foo6_c(x) { >1 : 1 const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number (() => x + y + v); @@ -828,13 +827,13 @@ function foo6_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -853,22 +852,22 @@ function foo7_c(x) { do { const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number (() => x + y + v); @@ -876,13 +875,13 @@ function foo7_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; @@ -904,27 +903,27 @@ function foo8_c(x) { >x : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 var v = x; >v : number ->x : number +>x : 1 (function() { return x + y + v }); >(function() { return x + y + v }) : () => number >function() { return x + y + v } : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 >v : number (() => x + y + v); @@ -932,13 +931,13 @@ function foo8_c(x) { >() => x + y + v : () => number >x + y + v : number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 >v : number if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 return; diff --git a/tests/baselines/reference/capturedLetConstInLoop6.types b/tests/baselines/reference/capturedLetConstInLoop6.types index a7d28222bb09f..c7f6392139e97 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6.types +++ b/tests/baselines/reference/capturedLetConstInLoop6.types @@ -63,10 +63,10 @@ for (let x in []) { for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -165,16 +165,16 @@ do { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x}); >(function() { return x}) : () => number @@ -204,12 +204,12 @@ for (let y = 0; y < 1; ++y) { for (let x = 0, y = 1; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >y : number ->1 : number +>1 : 1 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -322,16 +322,16 @@ do { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number @@ -427,32 +427,32 @@ for (const x in []) { for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 0 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; @@ -465,29 +465,29 @@ while (1 === 1) { >1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -496,29 +496,29 @@ while (1 === 1) { do { const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -529,36 +529,36 @@ do { >1 : 1 for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -566,38 +566,38 @@ for (const y = 0; y < 1;) { } for (const x = 0, y = 1; x < 1;) { ->x : number ->0 : number ->y : number ->1 : number +>x : 0 +>0 : 0 +>y : 1 +>1 : 1 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; @@ -610,35 +610,35 @@ while (1 === 1) { >1 : 1 const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -647,35 +647,35 @@ while (1 === 1) { do { const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -686,40 +686,40 @@ do { >1 : 1 for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.types b/tests/baselines/reference/capturedLetConstInLoop6_ES6.types index 14635c0cd1c8a..79da473e9344e 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.types @@ -63,10 +63,10 @@ for (let x in []) { for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -165,16 +165,16 @@ do { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x}); >(function() { return x}) : () => number @@ -204,12 +204,12 @@ for (let y = 0; y < 1; ++y) { for (let x = 0, y = 1; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >y : number ->1 : number +>1 : 1 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -322,16 +322,16 @@ do { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number @@ -427,32 +427,32 @@ for (const x in []) { for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 0 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; @@ -465,29 +465,29 @@ while (1 === 1) { >1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -496,29 +496,29 @@ while (1 === 1) { do { const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -529,36 +529,36 @@ do { >1 : 1 for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -566,38 +566,38 @@ for (const y = 0; y < 1;) { } for (const x = 0, y = 1; x < 1;) { ->x : number ->0 : number ->y : number ->1 : number +>x : 0 +>0 : 0 +>y : 1 +>1 : 1 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; @@ -610,35 +610,35 @@ while (1 === 1) { >1 : 1 const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -647,35 +647,35 @@ while (1 === 1) { do { const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; @@ -686,40 +686,40 @@ do { >1 : 1 for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; diff --git a/tests/baselines/reference/capturedLetConstInLoop7.types b/tests/baselines/reference/capturedLetConstInLoop7.types index 641ccb9dbeacb..39f09100eeb37 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7.types +++ b/tests/baselines/reference/capturedLetConstInLoop7.types @@ -103,10 +103,10 @@ l1: for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -262,16 +262,16 @@ l4: for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x}); >(function() { return x}) : () => number @@ -320,12 +320,12 @@ l5: for (let x = 0, y = 1; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >y : number ->1 : number +>1 : 1 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -496,16 +496,16 @@ l8: for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number @@ -656,32 +656,32 @@ l1_c: >l1_c : any for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 0 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break l1_c; @@ -689,14 +689,14 @@ for (const x = 0; x < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l1_c; @@ -713,29 +713,29 @@ while (1 === 1) { >1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l2_c; @@ -743,14 +743,14 @@ while (1 === 1) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l2_c; @@ -763,29 +763,29 @@ l3_c: do { const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l3_c; @@ -793,14 +793,14 @@ do { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l3_c; @@ -815,36 +815,36 @@ l4_c: >l4_c : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l4_c; @@ -852,14 +852,14 @@ for (const y = 0; y < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l4_c; @@ -871,38 +871,38 @@ l5_c: >l5_c : any for (const x = 0, y = 1; x < 1;) { ->x : number ->0 : number ->y : number ->1 : number +>x : 0 +>0 : 0 +>y : 1 +>1 : 1 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break l5_c; @@ -910,14 +910,14 @@ for (const x = 0, y = 1; x < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l5_c; @@ -934,35 +934,35 @@ while (1 === 1) { >1 : 1 const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l6_c; @@ -970,14 +970,14 @@ while (1 === 1) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l6_c; @@ -991,35 +991,35 @@ l7_c: do { const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l7_c; @@ -1027,14 +1027,14 @@ do { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l7_c; @@ -1049,40 +1049,40 @@ l8_c: >l8_c : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l8_c; @@ -1090,14 +1090,14 @@ for (const y = 0; y < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l8_c; diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.types b/tests/baselines/reference/capturedLetConstInLoop7_ES6.types index 666f3e33e0f2c..48499659aa3ba 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.types @@ -103,10 +103,10 @@ l1: for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -262,16 +262,16 @@ l4: for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x}); >(function() { return x}) : () => number @@ -320,12 +320,12 @@ l5: for (let x = 0, y = 1; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >y : number ->1 : number +>1 : 1 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -496,16 +496,16 @@ l8: for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number let x = 1; >x : number ->1 : number +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number @@ -656,32 +656,32 @@ l1_c: >l1_c : any for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 0 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break l1_c; @@ -689,14 +689,14 @@ for (const x = 0; x < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l1_c; @@ -713,29 +713,29 @@ while (1 === 1) { >1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l2_c; @@ -743,14 +743,14 @@ while (1 === 1) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l2_c; @@ -763,29 +763,29 @@ l3_c: do { const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l3_c; @@ -793,14 +793,14 @@ do { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l3_c; @@ -815,36 +815,36 @@ l4_c: >l4_c : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x}); >(function() { return x}) : () => number >function() { return x} : () => number ->x : number +>x : 1 (() => x); >(() => x) : () => number >() => x : () => number ->x : number +>x : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l4_c; @@ -852,14 +852,14 @@ for (const y = 0; y < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l4_c; @@ -871,38 +871,38 @@ l5_c: >l5_c : any for (const x = 0, y = 1; x < 1;) { ->x : number ->0 : number ->y : number ->1 : number +>x : 0 +>0 : 0 +>y : 1 +>1 : 1 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break l5_c; @@ -910,14 +910,14 @@ for (const x = 0, y = 1; x < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l5_c; @@ -934,35 +934,35 @@ while (1 === 1) { >1 : 1 const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l6_c; @@ -970,14 +970,14 @@ while (1 === 1) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l6_c; @@ -991,35 +991,35 @@ l7_c: do { const x = 1, y = 1; ->x : number ->1 : number ->y : number ->1 : number +>x : 1 +>1 : 1 +>y : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 1 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l7_c; @@ -1027,14 +1027,14 @@ do { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l7_c; @@ -1049,40 +1049,40 @@ l8_c: >l8_c : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 (function() { return x + y}); >(function() { return x + y}) : () => number >function() { return x + y} : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 1 +>y : 0 if (x == 1) { >x == 1 : boolean ->x : number +>x : 1 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : never >1 : 1 break l8_c; @@ -1090,14 +1090,14 @@ for (const y = 0; y < 1;) { } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : never >2 : 2 continue l8_c; diff --git a/tests/baselines/reference/capturedLetConstInLoop8.types b/tests/baselines/reference/capturedLetConstInLoop8.types index 618e71038ffd6..264733080391e 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8.types +++ b/tests/baselines/reference/capturedLetConstInLoop8.types @@ -1,16 +1,16 @@ === tests/cases/compiler/capturedLetConstInLoop8.ts === function foo() { ->foo : () => string +>foo : () => "123" | "456" l0: >l0 : any for (let z = 0; z < 1; ++z) { >z : number ->0 : number +>0 : 0 >z < 1 : boolean >z : number ->1 : number +>1 : 1 >++z : number >z : number @@ -19,10 +19,10 @@ function foo() { for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -31,10 +31,10 @@ function foo() { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number @@ -113,7 +113,7 @@ function foo() { >2 : 2 return "123" ->"123" : string +>"123" : "123" } if (x == 3) { >x == 3 : boolean @@ -167,7 +167,7 @@ function foo() { >2 : 2 return "456"; ->"456" : string +>"456" : "456" } if (x == 3) { >x == 3 : boolean @@ -181,62 +181,62 @@ function foo() { } function foo_c() { ->foo_c : () => string +>foo_c : () => "123" | "456" l0: >l0 : any for (const z = 0; z < 1;) { ->z : number ->0 : number +>z : 0 +>0 : 0 >z < 1 : boolean ->z : number ->1 : number +>z : 0 +>1 : 1 l1: >l1 : any for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 ll1: >ll1 : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 (function() { return x + y }); >(function() { return x + y }) : () => number >function() { return x + y } : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 0 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 0 if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 break; } if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 break l1; @@ -244,7 +244,7 @@ function foo_c() { } if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 break ll1; @@ -252,7 +252,7 @@ function foo_c() { } if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 continue l0; @@ -261,14 +261,14 @@ function foo_c() { if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l1; @@ -276,7 +276,7 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue ll1; @@ -284,15 +284,15 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 return "123" ->"123" : string +>"123" : "123" } if (x == 3) { >x == 3 : boolean ->x : number +>x : 0 >3 : 3 return; @@ -300,14 +300,14 @@ function foo_c() { } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break l1; @@ -315,14 +315,14 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l1; @@ -330,7 +330,7 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l0; @@ -338,15 +338,15 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 return "456"; ->"456" : string +>"456" : "456" } if (x == 3) { >x == 3 : boolean ->x : number +>x : 0 >3 : 3 return; diff --git a/tests/baselines/reference/capturedLetConstInLoop8_ES6.types b/tests/baselines/reference/capturedLetConstInLoop8_ES6.types index 0b877d27a4632..99d07bb99bf54 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop8_ES6.types @@ -1,16 +1,16 @@ === tests/cases/compiler/capturedLetConstInLoop8_ES6.ts === function foo() { ->foo : () => string +>foo : () => "123" | "456" l0: >l0 : any for (let z = 0; z < 1; ++z) { >z : number ->0 : number +>0 : 0 >z < 1 : boolean >z : number ->1 : number +>1 : 1 >++z : number >z : number @@ -19,10 +19,10 @@ function foo() { for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -31,10 +31,10 @@ function foo() { for (let y = 0; y < 1; ++y) { >y : number ->0 : number +>0 : 0 >y < 1 : boolean >y : number ->1 : number +>1 : 1 >++y : number >y : number @@ -113,7 +113,7 @@ function foo() { >2 : 2 return "123" ->"123" : string +>"123" : "123" } if (x == 3) { >x == 3 : boolean @@ -167,7 +167,7 @@ function foo() { >2 : 2 return "456"; ->"456" : string +>"456" : "456" } if (x == 3) { >x == 3 : boolean @@ -181,62 +181,62 @@ function foo() { } function foo_c() { ->foo_c : () => string +>foo_c : () => "123" | "456" l0: >l0 : any for (const z = 0; z < 1;) { ->z : number ->0 : number +>z : 0 +>0 : 0 >z < 1 : boolean ->z : number ->1 : number +>z : 0 +>1 : 1 l1: >l1 : any for (const x = 0; x < 1;) { ->x : number ->0 : number +>x : 0 +>0 : 0 >x < 1 : boolean ->x : number ->1 : number +>x : 0 +>1 : 1 ll1: >ll1 : any for (const y = 0; y < 1;) { ->y : number ->0 : number +>y : 0 +>0 : 0 >y < 1 : boolean ->y : number ->1 : number +>y : 0 +>1 : 1 (function() { return x + y }); >(function() { return x + y }) : () => number >function() { return x + y } : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 0 (() => x + y); >(() => x + y) : () => number >() => x + y : () => number >x + y : number ->x : number ->y : number +>x : 0 +>y : 0 if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 break; } if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 break l1; @@ -244,7 +244,7 @@ function foo_c() { } if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 break ll1; @@ -252,7 +252,7 @@ function foo_c() { } if (y == 1) { >y == 1 : boolean ->y : number +>y : 0 >1 : 1 continue l0; @@ -261,14 +261,14 @@ function foo_c() { if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l1; @@ -276,7 +276,7 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue ll1; @@ -284,15 +284,15 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 return "123" ->"123" : string +>"123" : "123" } if (x == 3) { >x == 3 : boolean ->x : number +>x : 0 >3 : 3 return; @@ -300,14 +300,14 @@ function foo_c() { } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break; } if (x == 1) { >x == 1 : boolean ->x : number +>x : 0 >1 : 1 break l1; @@ -315,14 +315,14 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue; } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l1; @@ -330,7 +330,7 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 continue l0; @@ -338,15 +338,15 @@ function foo_c() { } if (x == 2) { >x == 2 : boolean ->x : number +>x : 0 >2 : 2 return "456"; ->"456" : string +>"456" : "456" } if (x == 3) { >x == 3 : boolean ->x : number +>x : 0 >3 : 3 return; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt index 6bd8c30b205ca..03f16420e108e 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.errors.txt @@ -1,126 +1,22 @@ -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(12,14): error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(13,14): error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(14,14): error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(15,14): error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(16,14): error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(17,14): error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(18,14): error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(19,14): error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(22,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(23,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(24,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(25,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(26,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(27,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(28,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(30,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(31,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(32,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(33,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(34,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(35,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(36,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(39,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(40,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(41,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(42,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(43,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(44,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(45,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(47,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(48,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(49,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(50,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(51,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(52,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(53,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(56,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(57,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(58,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(59,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(60,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(61,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(62,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(64,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(65,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(66,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(67,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(68,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(69,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(70,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(73,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(74,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(75,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(76,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(77,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(78,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(79,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(81,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(82,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(83,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(84,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(85,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(86,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(87,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(90,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(91,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(92,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(93,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(94,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(95,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(96,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(98,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(99,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(100,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(101,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(102,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(103,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(104,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(107,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(108,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(109,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(110,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(111,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(112,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(113,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(115,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(116,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(117,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(118,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(119,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(120,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(121,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(124,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(125,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(126,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(127,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(128,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(129,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(130,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(132,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(133,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(134,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(135,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(136,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(137,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(138,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(141,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(142,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(143,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(144,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(145,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(146,16): error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(147,16): error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(149,16): error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(150,16): error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(151,16): error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(152,16): error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(153,16): error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(154,16): error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(155,16): error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(25,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(33,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(42,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(50,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(59,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(67,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(76,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(84,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(93,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(101,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(110,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(118,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(127,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(135,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(144,16): error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts(152,16): error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts (120 errors) ==== +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipTypeParameter.ts (16 errors) ==== enum E { a, b, c } var a: boolean; @@ -133,387 +29,179 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso function foo(t: T, u: U) { var r1 = t < u; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. var r2 = t > u; - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. var r3 = t <= u; - ~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. var r4 = t >= u; - ~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. var r5 = t == u; - ~~~~~~ -!!! error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. var r6 = t != u; - ~~~~~~ -!!! error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. var r7 = t === u; - ~~~~~~~ -!!! error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. var r8 = t !== u; - ~~~~~~~ -!!! error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. // operator < var r1a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r1a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r1a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r1a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r1a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r1a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r1a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r1b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r1b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r1b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r1b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r1b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r1b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r1b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator > var r2a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r2a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r2a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r2a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r2a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r2a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r2a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r2b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r2b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r2b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r2b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r2b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r2b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r2b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator <= var r3a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r3a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r3a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r3a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r3a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r3a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r3a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r3b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r3b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r3b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r3b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r3b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r3b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r3b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator >= var r4a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r4a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r4a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r4a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r4a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r4a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r4a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r4b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r4b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r4b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r4b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r4b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r4b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r4b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator == var r5a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r5a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r5a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r5a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r5a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r5a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r5a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r5b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r5b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r5b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r5b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r5b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r5b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r5b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator != var r6a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r6a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r6a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r6a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r6a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r6a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r6a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r6b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r6b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r6b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r6b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r6b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r6b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r6b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator === var r7a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r7a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r7a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r7a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r7a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r7a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r7a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r7b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r7b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r7b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r7b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r7b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r7b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r7b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. // operator !== var r8a1 = t < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'boolean'. var r8a2 = t < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'number'. var r8a3 = t < c; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'string'. var r8a4 = t < d; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'void'. +!!! error TS2365: Operator '<' cannot be applied to types '{}' and 'void'. var r8a5 = t < e; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'E'. var r8a6 = t < f; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and '{ a: string; }'. var r8a7 = t < g; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'any[]'. var r8b1 = a < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'boolean' and 'T'. var r8b2 = b < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'number' and 'T'. var r8b3 = c < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'T'. var r8b4 = d < t; ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'void' and 'T'. +!!! error TS2365: Operator '<' cannot be applied to types 'void' and '{}'. var r8b5 = e < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'E' and 'T'. var r8b6 = f < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ a: string; }' and 'T'. var r8b7 = g < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'any[]' and 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt index e8193e91a0f77..c6dde4401ea52 100644 --- a/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithTypeParameter.errors.txt @@ -1,142 +1,54 @@ -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(6,15): error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(7,15): error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(8,15): error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(9,15): error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(10,15): error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(11,15): error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(12,15): error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(13,15): error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(15,15): error TS2365: Operator '<' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(16,15): error TS2365: Operator '>' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(17,15): error TS2365: Operator '<=' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(18,15): error TS2365: Operator '>=' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(19,15): error TS2365: Operator '==' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(20,15): error TS2365: Operator '!=' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(21,15): error TS2365: Operator '===' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(22,15): error TS2365: Operator '!==' cannot be applied to types 'U' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(24,15): error TS2365: Operator '<' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(25,15): error TS2365: Operator '>' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(26,15): error TS2365: Operator '<=' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(27,15): error TS2365: Operator '>=' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(28,15): error TS2365: Operator '==' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(29,15): error TS2365: Operator '!=' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(30,15): error TS2365: Operator '===' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(31,15): error TS2365: Operator '!==' cannot be applied to types 'T' and 'V'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(33,15): error TS2365: Operator '<' cannot be applied to types 'V' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(34,15): error TS2365: Operator '>' cannot be applied to types 'V' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(35,15): error TS2365: Operator '<=' cannot be applied to types 'V' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(36,15): error TS2365: Operator '>=' cannot be applied to types 'V' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(37,15): error TS2365: Operator '==' cannot be applied to types 'V' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(38,15): error TS2365: Operator '!=' cannot be applied to types 'V' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(39,15): error TS2365: Operator '===' cannot be applied to types 'V' and 'T'. -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(40,15): error TS2365: Operator '!==' cannot be applied to types 'V' and 'T'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(93,15): error TS2365: Operator '<' cannot be applied to types 'Number' and 'String'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(94,15): error TS2365: Operator '>' cannot be applied to types 'Number' and 'String'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(95,15): error TS2365: Operator '<=' cannot be applied to types 'Number' and 'String'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(96,15): error TS2365: Operator '>=' cannot be applied to types 'Number' and 'String'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(97,15): error TS2365: Operator '==' cannot be applied to types 'Number' and 'String'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(98,15): error TS2365: Operator '!=' cannot be applied to types 'Number' and 'String'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(99,15): error TS2365: Operator '===' cannot be applied to types 'Number' and 'String'. +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts(100,15): error TS2365: Operator '!==' cannot be applied to types 'Number' and 'String'. -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts (32 errors) ==== +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts (8 errors) ==== var a: {}; var b: Object; function foo(t: T, u: U, v: V) { // errors var ra1 = t < u; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'U'. var ra2 = t > u; - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'T' and 'U'. var ra3 = t <= u; - ~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'T' and 'U'. var ra4 = t >= u; - ~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'T' and 'U'. var ra5 = t == u; - ~~~~~~ -!!! error TS2365: Operator '==' cannot be applied to types 'T' and 'U'. var ra6 = t != u; - ~~~~~~ -!!! error TS2365: Operator '!=' cannot be applied to types 'T' and 'U'. var ra7 = t === u; - ~~~~~~~ -!!! error TS2365: Operator '===' cannot be applied to types 'T' and 'U'. var ra8 = t !== u; - ~~~~~~~ -!!! error TS2365: Operator '!==' cannot be applied to types 'T' and 'U'. var rb1 = u < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'U' and 'T'. var rb2 = u > t; - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'U' and 'T'. var rb3 = u <= t; - ~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'U' and 'T'. var rb4 = u >= t; - ~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'U' and 'T'. var rb5 = u == t; - ~~~~~~ -!!! error TS2365: Operator '==' cannot be applied to types 'U' and 'T'. var rb6 = u != t; - ~~~~~~ -!!! error TS2365: Operator '!=' cannot be applied to types 'U' and 'T'. var rb7 = u === t; - ~~~~~~~ -!!! error TS2365: Operator '===' cannot be applied to types 'U' and 'T'. var rb8 = u !== t; - ~~~~~~~ -!!! error TS2365: Operator '!==' cannot be applied to types 'U' and 'T'. var rc1 = t < v; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'T' and 'V'. var rc2 = t > v; - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'T' and 'V'. var rc3 = t <= v; - ~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'T' and 'V'. var rc4 = t >= v; - ~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'T' and 'V'. var rc5 = t == v; - ~~~~~~ -!!! error TS2365: Operator '==' cannot be applied to types 'T' and 'V'. var rc6 = t != v; - ~~~~~~ -!!! error TS2365: Operator '!=' cannot be applied to types 'T' and 'V'. var rc7 = t === v; - ~~~~~~~ -!!! error TS2365: Operator '===' cannot be applied to types 'T' and 'V'. var rc8 = t !== v; - ~~~~~~~ -!!! error TS2365: Operator '!==' cannot be applied to types 'T' and 'V'. var rd1 = v < t; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'V' and 'T'. var rd2 = v > t; - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'V' and 'T'. var rd3 = v <= t; - ~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'V' and 'T'. var rd4 = v >= t; - ~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'V' and 'T'. var rd5 = v == t; - ~~~~~~ -!!! error TS2365: Operator '==' cannot be applied to types 'V' and 'T'. var rd6 = v != t; - ~~~~~~ -!!! error TS2365: Operator '!=' cannot be applied to types 'V' and 'T'. var rd7 = v === t; - ~~~~~~~ -!!! error TS2365: Operator '===' cannot be applied to types 'V' and 'T'. var rd8 = v !== t; - ~~~~~~~ -!!! error TS2365: Operator '!==' cannot be applied to types 'V' and 'T'. // ok var re1 = t < a; @@ -174,4 +86,54 @@ tests/cases/conformance/expressions/binaryOperators/comparisonOperator/compariso var rh6 = b != t; var rh7 = b === t; var rh8 = b !== t; - } \ No newline at end of file + } + + function Generic(t: T, b: U, v: V, w: W) { + + // generics with related constraints, ok + var ri1 = b < t; + var ri2 = b > t; + var ri3 = b <= t; + var ri4 = b >= t; + var ri5 = b == t; + var ri6 = b != t; + var ri7 = b === t; + var ri8 = b !== t; + + // generics with constraints that preventing conforming values from matching, error + var rj1 = v < t; + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types 'Number' and 'String'. + var rj2 = v > t; + ~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types 'Number' and 'String'. + var rj3 = v <= t; + ~~~~~~ +!!! error TS2365: Operator '<=' cannot be applied to types 'Number' and 'String'. + var rj4 = v >= t; + ~~~~~~ +!!! error TS2365: Operator '>=' cannot be applied to types 'Number' and 'String'. + var rj5 = v == t; + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types 'Number' and 'String'. + var rj6 = v != t; + ~~~~~~ +!!! error TS2365: Operator '!=' cannot be applied to types 'Number' and 'String'. + var rj7 = v === t; + ~~~~~~~ +!!! error TS2365: Operator '===' cannot be applied to types 'Number' and 'String'. + var rj8 = v !== t; + ~~~~~~~ +!!! error TS2365: Operator '!==' cannot be applied to types 'Number' and 'String'. + + // generics with vs. without constraint, can match, ok + var rk1 = w < t; + var rk2 = w > t; + var rk3 = w <= t; + var rk4 = w >= t; + var rk5 = w == t; + var rk6 = w != t; + var rk7 = w === t; + var rk8 = w !== t; + } + \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithTypeParameter.js b/tests/baselines/reference/comparisonOperatorWithTypeParameter.js index 67d33eca22366..a3f1baf0eff9f 100644 --- a/tests/baselines/reference/comparisonOperatorWithTypeParameter.js +++ b/tests/baselines/reference/comparisonOperatorWithTypeParameter.js @@ -76,7 +76,41 @@ function foo(t: T, u: U, v: V) { var rh6 = b != t; var rh7 = b === t; var rh8 = b !== t; -} +} + +function Generic(t: T, b: U, v: V, w: W) { + + // generics with related constraints, ok + var ri1 = b < t; + var ri2 = b > t; + var ri3 = b <= t; + var ri4 = b >= t; + var ri5 = b == t; + var ri6 = b != t; + var ri7 = b === t; + var ri8 = b !== t; + + // generics with constraints that preventing conforming values from matching, error + var rj1 = v < t; + var rj2 = v > t; + var rj3 = v <= t; + var rj4 = v >= t; + var rj5 = v == t; + var rj6 = v != t; + var rj7 = v === t; + var rj8 = v !== t; + + // generics with vs. without constraint, can match, ok + var rk1 = w < t; + var rk2 = w > t; + var rk3 = w <= t; + var rk4 = w >= t; + var rk5 = w == t; + var rk6 = w != t; + var rk7 = w === t; + var rk8 = w !== t; +} + //// [comparisonOperatorWithTypeParameter.js] var a; @@ -149,3 +183,32 @@ function foo(t, u, v) { var rh7 = b === t; var rh8 = b !== t; } +function Generic(t, b, v, w) { + // generics with related constraints, ok + var ri1 = b < t; + var ri2 = b > t; + var ri3 = b <= t; + var ri4 = b >= t; + var ri5 = b == t; + var ri6 = b != t; + var ri7 = b === t; + var ri8 = b !== t; + // generics with constraints that preventing conforming values from matching, error + var rj1 = v < t; + var rj2 = v > t; + var rj3 = v <= t; + var rj4 = v >= t; + var rj5 = v == t; + var rj6 = v != t; + var rj7 = v === t; + var rj8 = v !== t; + // generics with vs. without constraint, can match, ok + var rk1 = w < t; + var rk2 = w > t; + var rk3 = w <= t; + var rk4 = w >= t; + var rk5 = w == t; + var rk6 = w != t; + var rk7 = w === t; + var rk8 = w !== t; +} diff --git a/tests/baselines/reference/discriminatedUnionTypes1.symbols b/tests/baselines/reference/discriminatedUnionTypes1.symbols new file mode 100644 index 0000000000000..380694474239a --- /dev/null +++ b/tests/baselines/reference/discriminatedUnionTypes1.symbols @@ -0,0 +1,402 @@ +=== tests/cases/conformance/types/union/discriminatedUnionTypes1.ts === +interface Square { +>Square : Symbol(Square, Decl(discriminatedUnionTypes1.ts, 0, 0)) + + kind: "square"; +>kind : Symbol(Square.kind, Decl(discriminatedUnionTypes1.ts, 0, 18)) + + size: number; +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +} + +interface Rectangle { +>Rectangle : Symbol(Rectangle, Decl(discriminatedUnionTypes1.ts, 3, 1)) + + kind: "rectangle"; +>kind : Symbol(Rectangle.kind, Decl(discriminatedUnionTypes1.ts, 5, 21)) + + width: number; +>width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) + + height: number; +>height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) +} + +interface Circle { +>Circle : Symbol(Circle, Decl(discriminatedUnionTypes1.ts, 9, 1)) + + kind: "circle"; +>kind : Symbol(Circle.kind, Decl(discriminatedUnionTypes1.ts, 11, 18)) + + radius: number; +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +} + +type Shape = Square | Rectangle | Circle; +>Shape : Symbol(Shape, Decl(discriminatedUnionTypes1.ts, 14, 1)) +>Square : Symbol(Square, Decl(discriminatedUnionTypes1.ts, 0, 0)) +>Rectangle : Symbol(Rectangle, Decl(discriminatedUnionTypes1.ts, 3, 1)) +>Circle : Symbol(Circle, Decl(discriminatedUnionTypes1.ts, 9, 1)) + +function area1(s: Shape) { +>area1 : Symbol(area1, Decl(discriminatedUnionTypes1.ts, 16, 41)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>Shape : Symbol(Shape, Decl(discriminatedUnionTypes1.ts, 14, 1)) + + if (s.kind === "square") { +>s.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) + + return s.size * s.size; +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) + } + else if (s.kind === "circle") { +>s.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) + + return Math.PI * s.radius * s.radius; +>Math.PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) + } + else if (s.kind === "rectangle") { +>s.kind : Symbol(Rectangle.kind, Decl(discriminatedUnionTypes1.ts, 5, 21)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>kind : Symbol(Rectangle.kind, Decl(discriminatedUnionTypes1.ts, 5, 21)) + + return s.width * s.height; +>s.width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s.height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 18, 15)) +>height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) + } + else { + return 0; + } +} + +function area2(s: Shape) { +>area2 : Symbol(area2, Decl(discriminatedUnionTypes1.ts, 31, 1)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>Shape : Symbol(Shape, Decl(discriminatedUnionTypes1.ts, 14, 1)) + + switch (s.kind) { +>s.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) + + case "square": return s.size * s.size; +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) + + case "rectangle": return s.width * s.height; +>s.width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s.height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) + + case "circle": return Math.PI * s.radius * s.radius; +>Math.PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 33, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) + } +} + +function assertNever(x: never): never { +>assertNever : Symbol(assertNever, Decl(discriminatedUnionTypes1.ts, 39, 1)) +>x : Symbol(x, Decl(discriminatedUnionTypes1.ts, 41, 21)) + + throw new Error("Unexpected object: " + x); +>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(discriminatedUnionTypes1.ts, 41, 21)) +} + +function area3(s: Shape) { +>area3 : Symbol(area3, Decl(discriminatedUnionTypes1.ts, 43, 1)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>Shape : Symbol(Shape, Decl(discriminatedUnionTypes1.ts, 14, 1)) + + switch (s.kind) { +>s.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) + + case "square": return s.size * s.size; +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) + + case "rectangle": return s.width * s.height; +>s.width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s.height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) + + case "circle": return Math.PI * s.radius * s.radius; +>Math.PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) + + default: return assertNever(s); +>assertNever : Symbol(assertNever, Decl(discriminatedUnionTypes1.ts, 39, 1)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 45, 15)) + } +} + +function area4(s: Shape) { +>area4 : Symbol(area4, Decl(discriminatedUnionTypes1.ts, 52, 1)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>Shape : Symbol(Shape, Decl(discriminatedUnionTypes1.ts, 14, 1)) + + switch (s.kind) { +>s.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 0, 18), Decl(discriminatedUnionTypes1.ts, 5, 21), Decl(discriminatedUnionTypes1.ts, 11, 18)) + + case "square": return s.size * s.size; +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s.size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>size : Symbol(Square.size, Decl(discriminatedUnionTypes1.ts, 1, 19)) + + case "rectangle": return s.width * s.height; +>s.width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>width : Symbol(Rectangle.width, Decl(discriminatedUnionTypes1.ts, 6, 22)) +>s.height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>height : Symbol(Rectangle.height, Decl(discriminatedUnionTypes1.ts, 7, 18)) + + case "circle": return Math.PI * s.radius * s.radius; +>Math.PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>PI : Symbol(Math.PI, Decl(lib.d.ts, --, --)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s.radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +>radius : Symbol(Circle.radius, Decl(discriminatedUnionTypes1.ts, 12, 19)) + } + return assertNever(s); +>assertNever : Symbol(assertNever, Decl(discriminatedUnionTypes1.ts, 39, 1)) +>s : Symbol(s, Decl(discriminatedUnionTypes1.ts, 54, 15)) +} + +type Message = +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + { kind: "A", x: string } | +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5)) +>x : Symbol(x, Decl(discriminatedUnionTypes1.ts, 64, 16)) + + { kind: "B" | "C", y: number } | +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 65, 5)) +>y : Symbol(y, Decl(discriminatedUnionTypes1.ts, 65, 22)) + + { kind: "D" }; +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 66, 5)) + +function f1(m: Message) { +>f1 : Symbol(f1, Decl(discriminatedUnionTypes1.ts, 66, 18)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 68, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + if (m.kind === "A") { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 68, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + m; // { kind: "A", x: string } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 68, 12)) + } + else if (m.kind === "D") { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 68, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + m; // { kind: "D" } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 68, 12)) + } + else { + m; // { kind: "B" | "C", y: number } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 68, 12)) + } +} + +function f2(m: Message) { +>f2 : Symbol(f2, Decl(discriminatedUnionTypes1.ts, 78, 1)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 80, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + if (m.kind === "A") { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 80, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + return; + } + m; // { kind: "B" | "C", y: number } | { kind: "D" } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 80, 12)) +} + +function f3(m: Message) { +>f3 : Symbol(f3, Decl(discriminatedUnionTypes1.ts, 85, 1)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 87, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + if (m.kind === "X") { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 87, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + m; // never +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 87, 12)) + } +} + +function f4(m: Message, x: "A" | "D") { +>f4 : Symbol(f4, Decl(discriminatedUnionTypes1.ts, 91, 1)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 93, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) +>x : Symbol(x, Decl(discriminatedUnionTypes1.ts, 93, 23)) + + if (m.kind == x) { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 93, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>x : Symbol(x, Decl(discriminatedUnionTypes1.ts, 93, 23)) + + m; // { kind: "A", x: string } | { kind: "D" } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 93, 12)) + } +} + +function f5(m: Message) { +>f5 : Symbol(f5, Decl(discriminatedUnionTypes1.ts, 97, 1)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 99, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + switch (m.kind) { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 99, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + case "A": + m; // { kind: "A", x: string } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 99, 12)) + + break; + case "D": + m; // { kind: "D" } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 99, 12)) + + break; + default: + m; // { kind: "B" | "C", y: number } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 99, 12)) + } +} + +function f6(m: Message) { +>f6 : Symbol(f6, Decl(discriminatedUnionTypes1.ts, 110, 1)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 112, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + switch (m.kind) { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 112, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + case "A": + m; // { kind: "A", x: string } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 112, 12)) + + case "D": + m; // { kind: "A", x: string } | { kind: "D" } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 112, 12)) + + break; + default: + m; // { kind: "B" | "C", y: number } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 112, 12)) + } +} + +function f7(m: Message) { +>f7 : Symbol(f7, Decl(discriminatedUnionTypes1.ts, 122, 1)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 124, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + switch (m.kind) { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 124, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + case "A": + case "B": + return; + } + m; // { kind: "B" | "C", y: number } | { kind: "D" } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 124, 12)) +} + +function f8(m: Message) { +>f8 : Symbol(f8, Decl(discriminatedUnionTypes1.ts, 131, 1)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 133, 12)) +>Message : Symbol(Message, Decl(discriminatedUnionTypes1.ts, 61, 1)) + + switch (m.kind) { +>m.kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 133, 12)) +>kind : Symbol(kind, Decl(discriminatedUnionTypes1.ts, 64, 5), Decl(discriminatedUnionTypes1.ts, 65, 5), Decl(discriminatedUnionTypes1.ts, 66, 5)) + + case "A": + return; + case "D": + throw new Error(); +>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + } + m; // { kind: "B" | "C", y: number } +>m : Symbol(m, Decl(discriminatedUnionTypes1.ts, 133, 12)) +} diff --git a/tests/baselines/reference/discriminatedUnionTypes1.types b/tests/baselines/reference/discriminatedUnionTypes1.types new file mode 100644 index 0000000000000..b8e75000c314e --- /dev/null +++ b/tests/baselines/reference/discriminatedUnionTypes1.types @@ -0,0 +1,465 @@ +=== tests/cases/conformance/types/union/discriminatedUnionTypes1.ts === +interface Square { +>Square : Square + + kind: "square"; +>kind : "square" + + size: number; +>size : number +} + +interface Rectangle { +>Rectangle : Rectangle + + kind: "rectangle"; +>kind : "rectangle" + + width: number; +>width : number + + height: number; +>height : number +} + +interface Circle { +>Circle : Circle + + kind: "circle"; +>kind : "circle" + + radius: number; +>radius : number +} + +type Shape = Square | Rectangle | Circle; +>Shape : Shape +>Square : Square +>Rectangle : Rectangle +>Circle : Circle + +function area1(s: Shape) { +>area1 : (s: Shape) => number +>s : Shape +>Shape : Shape + + if (s.kind === "square") { +>s.kind === "square" : boolean +>s.kind : "square" | "rectangle" | "circle" +>s : Shape +>kind : "square" | "rectangle" | "circle" +>"square" : "square" + + return s.size * s.size; +>s.size * s.size : number +>s.size : number +>s : Square +>size : number +>s.size : number +>s : Square +>size : number + } + else if (s.kind === "circle") { +>s.kind === "circle" : boolean +>s.kind : "rectangle" | "circle" +>s : Rectangle | Circle +>kind : "rectangle" | "circle" +>"circle" : "circle" + + return Math.PI * s.radius * s.radius; +>Math.PI * s.radius * s.radius : number +>Math.PI * s.radius : number +>Math.PI : number +>Math : Math +>PI : number +>s.radius : number +>s : Circle +>radius : number +>s.radius : number +>s : Circle +>radius : number + } + else if (s.kind === "rectangle") { +>s.kind === "rectangle" : boolean +>s.kind : "rectangle" +>s : Rectangle +>kind : "rectangle" +>"rectangle" : "rectangle" + + return s.width * s.height; +>s.width * s.height : number +>s.width : number +>s : Rectangle +>width : number +>s.height : number +>s : Rectangle +>height : number + } + else { + return 0; +>0 : 0 + } +} + +function area2(s: Shape) { +>area2 : (s: Shape) => number +>s : Shape +>Shape : Shape + + switch (s.kind) { +>s.kind : "square" | "rectangle" | "circle" +>s : Shape +>kind : "square" | "rectangle" | "circle" + + case "square": return s.size * s.size; +>"square" : "square" +>s.size * s.size : number +>s.size : number +>s : Square +>size : number +>s.size : number +>s : Square +>size : number + + case "rectangle": return s.width * s.height; +>"rectangle" : "rectangle" +>s.width * s.height : number +>s.width : number +>s : Rectangle +>width : number +>s.height : number +>s : Rectangle +>height : number + + case "circle": return Math.PI * s.radius * s.radius; +>"circle" : "circle" +>Math.PI * s.radius * s.radius : number +>Math.PI * s.radius : number +>Math.PI : number +>Math : Math +>PI : number +>s.radius : number +>s : Circle +>radius : number +>s.radius : number +>s : Circle +>radius : number + } +} + +function assertNever(x: never): never { +>assertNever : (x: never) => never +>x : never + + throw new Error("Unexpected object: " + x); +>new Error("Unexpected object: " + x) : Error +>Error : ErrorConstructor +>"Unexpected object: " + x : string +>"Unexpected object: " : "Unexpected object: " +>x : never +} + +function area3(s: Shape) { +>area3 : (s: Shape) => number +>s : Shape +>Shape : Shape + + switch (s.kind) { +>s.kind : "square" | "rectangle" | "circle" +>s : Shape +>kind : "square" | "rectangle" | "circle" + + case "square": return s.size * s.size; +>"square" : "square" +>s.size * s.size : number +>s.size : number +>s : Square +>size : number +>s.size : number +>s : Square +>size : number + + case "rectangle": return s.width * s.height; +>"rectangle" : "rectangle" +>s.width * s.height : number +>s.width : number +>s : Rectangle +>width : number +>s.height : number +>s : Rectangle +>height : number + + case "circle": return Math.PI * s.radius * s.radius; +>"circle" : "circle" +>Math.PI * s.radius * s.radius : number +>Math.PI * s.radius : number +>Math.PI : number +>Math : Math +>PI : number +>s.radius : number +>s : Circle +>radius : number +>s.radius : number +>s : Circle +>radius : number + + default: return assertNever(s); +>assertNever(s) : never +>assertNever : (x: never) => never +>s : never + } +} + +function area4(s: Shape) { +>area4 : (s: Shape) => number +>s : Shape +>Shape : Shape + + switch (s.kind) { +>s.kind : "square" | "rectangle" | "circle" +>s : Shape +>kind : "square" | "rectangle" | "circle" + + case "square": return s.size * s.size; +>"square" : "square" +>s.size * s.size : number +>s.size : number +>s : Square +>size : number +>s.size : number +>s : Square +>size : number + + case "rectangle": return s.width * s.height; +>"rectangle" : "rectangle" +>s.width * s.height : number +>s.width : number +>s : Rectangle +>width : number +>s.height : number +>s : Rectangle +>height : number + + case "circle": return Math.PI * s.radius * s.radius; +>"circle" : "circle" +>Math.PI * s.radius * s.radius : number +>Math.PI * s.radius : number +>Math.PI : number +>Math : Math +>PI : number +>s.radius : number +>s : Circle +>radius : number +>s.radius : number +>s : Circle +>radius : number + } + return assertNever(s); +>assertNever(s) : never +>assertNever : (x: never) => never +>s : never +} + +type Message = +>Message : Message + + { kind: "A", x: string } | +>kind : "A" +>x : string + + { kind: "B" | "C", y: number } | +>kind : "B" | "C" +>y : number + + { kind: "D" }; +>kind : "D" + +function f1(m: Message) { +>f1 : (m: Message) => void +>m : Message +>Message : Message + + if (m.kind === "A") { +>m.kind === "A" : boolean +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" +>"A" : "A" + + m; // { kind: "A", x: string } +>m : { kind: "A"; x: string; } + } + else if (m.kind === "D") { +>m.kind === "D" : boolean +>m.kind : "B" | "C" | "D" +>m : { kind: "B" | "C"; y: number; } | { kind: "D"; } +>kind : "B" | "C" | "D" +>"D" : "D" + + m; // { kind: "D" } +>m : { kind: "D"; } + } + else { + m; // { kind: "B" | "C", y: number } +>m : { kind: "B" | "C"; y: number; } + } +} + +function f2(m: Message) { +>f2 : (m: Message) => void +>m : Message +>Message : Message + + if (m.kind === "A") { +>m.kind === "A" : boolean +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" +>"A" : "A" + + return; + } + m; // { kind: "B" | "C", y: number } | { kind: "D" } +>m : { kind: "B" | "C"; y: number; } | { kind: "D"; } +} + +function f3(m: Message) { +>f3 : (m: Message) => void +>m : Message +>Message : Message + + if (m.kind === "X") { +>m.kind === "X" : boolean +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" +>"X" : "X" + + m; // never +>m : Message + } +} + +function f4(m: Message, x: "A" | "D") { +>f4 : (m: Message, x: "A" | "D") => void +>m : Message +>Message : Message +>x : "A" | "D" + + if (m.kind == x) { +>m.kind == x : boolean +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" +>x : "A" | "D" + + m; // { kind: "A", x: string } | { kind: "D" } +>m : { kind: "A"; x: string; } | { kind: "D"; } + } +} + +function f5(m: Message) { +>f5 : (m: Message) => void +>m : Message +>Message : Message + + switch (m.kind) { +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" + + case "A": +>"A" : "A" + + m; // { kind: "A", x: string } +>m : { kind: "A"; x: string; } + + break; + case "D": +>"D" : "D" + + m; // { kind: "D" } +>m : { kind: "D"; } + + break; + default: + m; // { kind: "B" | "C", y: number } +>m : { kind: "B" | "C"; y: number; } + } +} + +function f6(m: Message) { +>f6 : (m: Message) => void +>m : Message +>Message : Message + + switch (m.kind) { +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" + + case "A": +>"A" : "A" + + m; // { kind: "A", x: string } +>m : { kind: "A"; x: string; } + + case "D": +>"D" : "D" + + m; // { kind: "A", x: string } | { kind: "D" } +>m : { kind: "A"; x: string; } | { kind: "D"; } + + break; + default: + m; // { kind: "B" | "C", y: number } +>m : { kind: "B" | "C"; y: number; } + } +} + +function f7(m: Message) { +>f7 : (m: Message) => void +>m : Message +>Message : Message + + switch (m.kind) { +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" + + case "A": +>"A" : "A" + + case "B": +>"B" : "B" + + return; + } + m; // { kind: "B" | "C", y: number } | { kind: "D" } +>m : { kind: "B" | "C"; y: number; } | { kind: "D"; } +} + +function f8(m: Message) { +>f8 : (m: Message) => void +>m : Message +>Message : Message + + switch (m.kind) { +>m.kind : "A" | "B" | "C" | "D" +>m : Message +>kind : "A" | "B" | "C" | "D" + + case "A": +>"A" : "A" + + return; + case "D": +>"D" : "D" + + throw new Error(); +>new Error() : Error +>Error : ErrorConstructor + } + m; // { kind: "B" | "C", y: number } +>m : { kind: "B" | "C"; y: number; } +} diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks01.symbols b/tests/baselines/reference/stringLiteralsWithEqualityChecks01.symbols new file mode 100644 index 0000000000000..721f6a2123cd7 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks01.symbols @@ -0,0 +1,75 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks01.ts === +let x: "foo"; +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks01.ts, 0, 3)) + +let y: "foo" | "bar"; +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +let b: boolean; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) + +b = x === y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks01.ts, 0, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = "foo" === y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = y === "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = "foo" === "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) + +b = "bar" === x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks01.ts, 0, 3)) + +b = x === "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks01.ts, 0, 3)) + +b = y === "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = "bar" === y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = x !== y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks01.ts, 0, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = "foo" !== y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = y !== "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = "foo" !== "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) + +b = "bar" !== x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks01.ts, 0, 3)) + +b = x !== "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks01.ts, 0, 3)) + +b = y !== "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + +b = "bar" !== y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks01.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks01.ts, 1, 3)) + + diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks01.types b/tests/baselines/reference/stringLiteralsWithEqualityChecks01.types new file mode 100644 index 0000000000000..c81e6de8458da --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks01.types @@ -0,0 +1,123 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks01.ts === +let x: "foo"; +>x : "foo" + +let y: "foo" | "bar"; +>y : "foo" | "bar" + +let b: boolean; +>b : boolean + +b = x === y; +>b = x === y : boolean +>b : boolean +>x === y : boolean +>x : "foo" +>y : "foo" | "bar" + +b = "foo" === y +>b = "foo" === y : boolean +>b : boolean +>"foo" === y : boolean +>"foo" : "foo" +>y : "foo" | "bar" + +b = y === "foo"; +>b = y === "foo" : boolean +>b : boolean +>y === "foo" : boolean +>y : "foo" | "bar" +>"foo" : "foo" + +b = "foo" === "bar"; +>b = "foo" === "bar" : boolean +>b : boolean +>"foo" === "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" === x; +>b = "bar" === x : boolean +>b : boolean +>"bar" === x : boolean +>"bar" : "bar" +>x : "foo" + +b = x === "bar"; +>b = x === "bar" : boolean +>b : boolean +>x === "bar" : boolean +>x : "foo" +>"bar" : "bar" + +b = y === "bar"; +>b = y === "bar" : boolean +>b : boolean +>y === "bar" : boolean +>y : "foo" | "bar" +>"bar" : "bar" + +b = "bar" === y; +>b = "bar" === y : boolean +>b : boolean +>"bar" === y : boolean +>"bar" : "bar" +>y : "foo" | "bar" + +b = x !== y; +>b = x !== y : boolean +>b : boolean +>x !== y : boolean +>x : "foo" +>y : "foo" | "bar" + +b = "foo" !== y +>b = "foo" !== y : boolean +>b : boolean +>"foo" !== y : boolean +>"foo" : "foo" +>y : "foo" | "bar" + +b = y !== "foo"; +>b = y !== "foo" : boolean +>b : boolean +>y !== "foo" : boolean +>y : "foo" | "bar" +>"foo" : "foo" + +b = "foo" !== "bar"; +>b = "foo" !== "bar" : boolean +>b : boolean +>"foo" !== "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" !== x; +>b = "bar" !== x : boolean +>b : boolean +>"bar" !== x : boolean +>"bar" : "bar" +>x : "foo" + +b = x !== "bar"; +>b = x !== "bar" : boolean +>b : boolean +>x !== "bar" : boolean +>x : "foo" +>"bar" : "bar" + +b = y !== "bar"; +>b = y !== "bar" : boolean +>b : boolean +>y !== "bar" : boolean +>y : "foo" | "bar" +>"bar" : "bar" + +b = "bar" !== y; +>b = "bar" !== y : boolean +>b : boolean +>"bar" !== y : boolean +>"bar" : "bar" +>y : "foo" | "bar" + + diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks02.symbols b/tests/baselines/reference/stringLiteralsWithEqualityChecks02.symbols new file mode 100644 index 0000000000000..496ec310c8a03 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks02.symbols @@ -0,0 +1,75 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks02.ts === +let x: "foo"; +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks02.ts, 0, 3)) + +let y: "foo" | "bar"; +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +let b: boolean; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) + +b = x == y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks02.ts, 0, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = "foo" == y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = y == "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = "foo" == "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) + +b = "bar" == x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks02.ts, 0, 3)) + +b = x == "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks02.ts, 0, 3)) + +b = y == "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = "bar" == y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = x != y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks02.ts, 0, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = "foo" != y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = y != "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = "foo" != "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) + +b = "bar" != x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks02.ts, 0, 3)) + +b = x != "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks02.ts, 0, 3)) + +b = y != "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + +b = "bar" != y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks02.ts, 1, 3)) + + diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks02.types b/tests/baselines/reference/stringLiteralsWithEqualityChecks02.types new file mode 100644 index 0000000000000..21086d852bc33 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks02.types @@ -0,0 +1,123 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks02.ts === +let x: "foo"; +>x : "foo" + +let y: "foo" | "bar"; +>y : "foo" | "bar" + +let b: boolean; +>b : boolean + +b = x == y; +>b = x == y : boolean +>b : boolean +>x == y : boolean +>x : "foo" +>y : "foo" | "bar" + +b = "foo" == y +>b = "foo" == y : boolean +>b : boolean +>"foo" == y : boolean +>"foo" : "foo" +>y : "foo" | "bar" + +b = y == "foo"; +>b = y == "foo" : boolean +>b : boolean +>y == "foo" : boolean +>y : "foo" | "bar" +>"foo" : "foo" + +b = "foo" == "bar"; +>b = "foo" == "bar" : boolean +>b : boolean +>"foo" == "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" == x; +>b = "bar" == x : boolean +>b : boolean +>"bar" == x : boolean +>"bar" : "bar" +>x : "foo" + +b = x == "bar"; +>b = x == "bar" : boolean +>b : boolean +>x == "bar" : boolean +>x : "foo" +>"bar" : "bar" + +b = y == "bar"; +>b = y == "bar" : boolean +>b : boolean +>y == "bar" : boolean +>y : "foo" | "bar" +>"bar" : "bar" + +b = "bar" == y; +>b = "bar" == y : boolean +>b : boolean +>"bar" == y : boolean +>"bar" : "bar" +>y : "foo" | "bar" + +b = x != y; +>b = x != y : boolean +>b : boolean +>x != y : boolean +>x : "foo" +>y : "foo" | "bar" + +b = "foo" != y +>b = "foo" != y : boolean +>b : boolean +>"foo" != y : boolean +>"foo" : "foo" +>y : "foo" | "bar" + +b = y != "foo"; +>b = y != "foo" : boolean +>b : boolean +>y != "foo" : boolean +>y : "foo" | "bar" +>"foo" : "foo" + +b = "foo" != "bar"; +>b = "foo" != "bar" : boolean +>b : boolean +>"foo" != "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" != x; +>b = "bar" != x : boolean +>b : boolean +>"bar" != x : boolean +>"bar" : "bar" +>x : "foo" + +b = x != "bar"; +>b = x != "bar" : boolean +>b : boolean +>x != "bar" : boolean +>x : "foo" +>"bar" : "bar" + +b = y != "bar"; +>b = y != "bar" : boolean +>b : boolean +>y != "bar" : boolean +>y : "foo" | "bar" +>"bar" : "bar" + +b = "bar" != y; +>b = "bar" != y : boolean +>b : boolean +>"bar" != y : boolean +>"bar" : "bar" +>y : "foo" | "bar" + + diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks03.symbols b/tests/baselines/reference/stringLiteralsWithEqualityChecks03.symbols new file mode 100644 index 0000000000000..14e60eb00d229 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks03.symbols @@ -0,0 +1,90 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks03.ts === +interface Runnable { +>Runnable : Symbol(Runnable, Decl(stringLiteralsWithEqualityChecks03.ts, 0, 0)) + + isRunning: boolean; +>isRunning : Symbol(Runnable.isRunning, Decl(stringLiteralsWithEqualityChecks03.ts, 0, 20)) +} + +interface Refrigerator extends Runnable { +>Refrigerator : Symbol(Refrigerator, Decl(stringLiteralsWithEqualityChecks03.ts, 2, 1)) +>Runnable : Symbol(Runnable, Decl(stringLiteralsWithEqualityChecks03.ts, 0, 0)) + + makesFoodGoBrrr: boolean; +>makesFoodGoBrrr : Symbol(Refrigerator.makesFoodGoBrrr, Decl(stringLiteralsWithEqualityChecks03.ts, 4, 41)) +} + +let x: string; +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks03.ts, 8, 3)) + +let y: "foo" | Refrigerator; +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) +>Refrigerator : Symbol(Refrigerator, Decl(stringLiteralsWithEqualityChecks03.ts, 2, 1)) + +let b: boolean; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) + +b = x === y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks03.ts, 8, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = "foo" === y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = y === "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = "foo" === "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) + +b = "bar" === x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks03.ts, 8, 3)) + +b = x === "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks03.ts, 8, 3)) + +b = y === "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = "bar" === y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = x !== y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks03.ts, 8, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = "foo" !== y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = y !== "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = "foo" !== "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) + +b = "bar" !== x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks03.ts, 8, 3)) + +b = x !== "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks03.ts, 8, 3)) + +b = y !== "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + +b = "bar" !== y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks03.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks03.ts, 9, 3)) + diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks03.types b/tests/baselines/reference/stringLiteralsWithEqualityChecks03.types new file mode 100644 index 0000000000000..a95c2c3abdab5 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks03.types @@ -0,0 +1,138 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks03.ts === +interface Runnable { +>Runnable : Runnable + + isRunning: boolean; +>isRunning : boolean +} + +interface Refrigerator extends Runnable { +>Refrigerator : Refrigerator +>Runnable : Runnable + + makesFoodGoBrrr: boolean; +>makesFoodGoBrrr : boolean +} + +let x: string; +>x : string + +let y: "foo" | Refrigerator; +>y : Refrigerator | "foo" +>Refrigerator : Refrigerator + +let b: boolean; +>b : boolean + +b = x === y; +>b = x === y : boolean +>b : boolean +>x === y : boolean +>x : string +>y : Refrigerator | "foo" + +b = "foo" === y +>b = "foo" === y : boolean +>b : boolean +>"foo" === y : boolean +>"foo" : "foo" +>y : Refrigerator | "foo" + +b = y === "foo"; +>b = y === "foo" : boolean +>b : boolean +>y === "foo" : boolean +>y : Refrigerator | "foo" +>"foo" : "foo" + +b = "foo" === "bar"; +>b = "foo" === "bar" : boolean +>b : boolean +>"foo" === "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" === x; +>b = "bar" === x : boolean +>b : boolean +>"bar" === x : boolean +>"bar" : "bar" +>x : string + +b = x === "bar"; +>b = x === "bar" : boolean +>b : boolean +>x === "bar" : boolean +>x : string +>"bar" : "bar" + +b = y === "bar"; +>b = y === "bar" : boolean +>b : boolean +>y === "bar" : boolean +>y : Refrigerator | "foo" +>"bar" : "bar" + +b = "bar" === y; +>b = "bar" === y : boolean +>b : boolean +>"bar" === y : boolean +>"bar" : "bar" +>y : Refrigerator | "foo" + +b = x !== y; +>b = x !== y : boolean +>b : boolean +>x !== y : boolean +>x : string +>y : Refrigerator | "foo" + +b = "foo" !== y +>b = "foo" !== y : boolean +>b : boolean +>"foo" !== y : boolean +>"foo" : "foo" +>y : Refrigerator | "foo" + +b = y !== "foo"; +>b = y !== "foo" : boolean +>b : boolean +>y !== "foo" : boolean +>y : Refrigerator | "foo" +>"foo" : "foo" + +b = "foo" !== "bar"; +>b = "foo" !== "bar" : boolean +>b : boolean +>"foo" !== "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" !== x; +>b = "bar" !== x : boolean +>b : boolean +>"bar" !== x : boolean +>"bar" : "bar" +>x : string + +b = x !== "bar"; +>b = x !== "bar" : boolean +>b : boolean +>x !== "bar" : boolean +>x : string +>"bar" : "bar" + +b = y !== "bar"; +>b = y !== "bar" : boolean +>b : boolean +>y !== "bar" : boolean +>y : Refrigerator | "foo" +>"bar" : "bar" + +b = "bar" !== y; +>b = "bar" !== y : boolean +>b : boolean +>"bar" !== y : boolean +>"bar" : "bar" +>y : Refrigerator | "foo" + diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks04.symbols b/tests/baselines/reference/stringLiteralsWithEqualityChecks04.symbols new file mode 100644 index 0000000000000..4cddc5d83fc23 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks04.symbols @@ -0,0 +1,90 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks04.ts === +interface Runnable { +>Runnable : Symbol(Runnable, Decl(stringLiteralsWithEqualityChecks04.ts, 0, 0)) + + isRunning: boolean; +>isRunning : Symbol(Runnable.isRunning, Decl(stringLiteralsWithEqualityChecks04.ts, 0, 20)) +} + +interface Refrigerator extends Runnable { +>Refrigerator : Symbol(Refrigerator, Decl(stringLiteralsWithEqualityChecks04.ts, 2, 1)) +>Runnable : Symbol(Runnable, Decl(stringLiteralsWithEqualityChecks04.ts, 0, 0)) + + makesFoodGoBrrr: boolean; +>makesFoodGoBrrr : Symbol(Refrigerator.makesFoodGoBrrr, Decl(stringLiteralsWithEqualityChecks04.ts, 4, 41)) +} + +let x: string; +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks04.ts, 8, 3)) + +let y: "foo" | Refrigerator; +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) +>Refrigerator : Symbol(Refrigerator, Decl(stringLiteralsWithEqualityChecks04.ts, 2, 1)) + +let b: boolean; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) + +b = x == y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks04.ts, 8, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = "foo" == y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = y == "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = "foo" == "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) + +b = "bar" == x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks04.ts, 8, 3)) + +b = x == "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks04.ts, 8, 3)) + +b = y == "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = "bar" == y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = x != y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks04.ts, 8, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = "foo" != y +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = y != "foo"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = "foo" != "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) + +b = "bar" != x; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks04.ts, 8, 3)) + +b = x != "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>x : Symbol(x, Decl(stringLiteralsWithEqualityChecks04.ts, 8, 3)) + +b = y != "bar"; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + +b = "bar" != y; +>b : Symbol(b, Decl(stringLiteralsWithEqualityChecks04.ts, 11, 3)) +>y : Symbol(y, Decl(stringLiteralsWithEqualityChecks04.ts, 9, 3)) + diff --git a/tests/baselines/reference/stringLiteralsWithEqualityChecks04.types b/tests/baselines/reference/stringLiteralsWithEqualityChecks04.types new file mode 100644 index 0000000000000..11683ae0386bd --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithEqualityChecks04.types @@ -0,0 +1,138 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithEqualityChecks04.ts === +interface Runnable { +>Runnable : Runnable + + isRunning: boolean; +>isRunning : boolean +} + +interface Refrigerator extends Runnable { +>Refrigerator : Refrigerator +>Runnable : Runnable + + makesFoodGoBrrr: boolean; +>makesFoodGoBrrr : boolean +} + +let x: string; +>x : string + +let y: "foo" | Refrigerator; +>y : Refrigerator | "foo" +>Refrigerator : Refrigerator + +let b: boolean; +>b : boolean + +b = x == y; +>b = x == y : boolean +>b : boolean +>x == y : boolean +>x : string +>y : Refrigerator | "foo" + +b = "foo" == y +>b = "foo" == y : boolean +>b : boolean +>"foo" == y : boolean +>"foo" : "foo" +>y : Refrigerator | "foo" + +b = y == "foo"; +>b = y == "foo" : boolean +>b : boolean +>y == "foo" : boolean +>y : Refrigerator | "foo" +>"foo" : "foo" + +b = "foo" == "bar"; +>b = "foo" == "bar" : boolean +>b : boolean +>"foo" == "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" == x; +>b = "bar" == x : boolean +>b : boolean +>"bar" == x : boolean +>"bar" : "bar" +>x : string + +b = x == "bar"; +>b = x == "bar" : boolean +>b : boolean +>x == "bar" : boolean +>x : string +>"bar" : "bar" + +b = y == "bar"; +>b = y == "bar" : boolean +>b : boolean +>y == "bar" : boolean +>y : Refrigerator | "foo" +>"bar" : "bar" + +b = "bar" == y; +>b = "bar" == y : boolean +>b : boolean +>"bar" == y : boolean +>"bar" : "bar" +>y : Refrigerator | "foo" + +b = x != y; +>b = x != y : boolean +>b : boolean +>x != y : boolean +>x : string +>y : Refrigerator | "foo" + +b = "foo" != y +>b = "foo" != y : boolean +>b : boolean +>"foo" != y : boolean +>"foo" : "foo" +>y : Refrigerator | "foo" + +b = y != "foo"; +>b = y != "foo" : boolean +>b : boolean +>y != "foo" : boolean +>y : Refrigerator | "foo" +>"foo" : "foo" + +b = "foo" != "bar"; +>b = "foo" != "bar" : boolean +>b : boolean +>"foo" != "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = "bar" != x; +>b = "bar" != x : boolean +>b : boolean +>"bar" != x : boolean +>"bar" : "bar" +>x : string + +b = x != "bar"; +>b = x != "bar" : boolean +>b : boolean +>x != "bar" : boolean +>x : string +>"bar" : "bar" + +b = y != "bar"; +>b = y != "bar" : boolean +>b : boolean +>y != "bar" : boolean +>y : Refrigerator | "foo" +>"bar" : "bar" + +b = "bar" != y; +>b = "bar" != y : boolean +>b : boolean +>"bar" != y : boolean +>"bar" : "bar" +>y : Refrigerator | "foo" + diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements02.symbols b/tests/baselines/reference/stringLiteralsWithSwitchStatements02.symbols new file mode 100644 index 0000000000000..6bba05e214c65 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements02.symbols @@ -0,0 +1,43 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements02.ts === +let x: "foo"; +>x : Symbol(x, Decl(stringLiteralsWithSwitchStatements02.ts, 0, 3)) + +let y: "foo" | "bar"; +>y : Symbol(y, Decl(stringLiteralsWithSwitchStatements02.ts, 1, 3)) + +let b: boolean; +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) + +b = x == y; +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithSwitchStatements02.ts, 0, 3)) +>y : Symbol(y, Decl(stringLiteralsWithSwitchStatements02.ts, 1, 3)) + +b = "foo" == y +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithSwitchStatements02.ts, 1, 3)) + +b = y == "foo"; +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithSwitchStatements02.ts, 1, 3)) + +b = "foo" == "bar"; +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) + +b = x != y; +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) +>x : Symbol(x, Decl(stringLiteralsWithSwitchStatements02.ts, 0, 3)) +>y : Symbol(y, Decl(stringLiteralsWithSwitchStatements02.ts, 1, 3)) + +b = "foo" != y +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithSwitchStatements02.ts, 1, 3)) + +b = y != "foo"; +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) +>y : Symbol(y, Decl(stringLiteralsWithSwitchStatements02.ts, 1, 3)) + +b = "foo" != "bar"; +>b : Symbol(b, Decl(stringLiteralsWithSwitchStatements02.ts, 3, 3)) + + diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements02.types b/tests/baselines/reference/stringLiteralsWithSwitchStatements02.types new file mode 100644 index 0000000000000..b7a8ab85f8401 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements02.types @@ -0,0 +1,67 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements02.ts === +let x: "foo"; +>x : "foo" + +let y: "foo" | "bar"; +>y : "foo" | "bar" + +let b: boolean; +>b : boolean + +b = x == y; +>b = x == y : boolean +>b : boolean +>x == y : boolean +>x : "foo" +>y : "foo" | "bar" + +b = "foo" == y +>b = "foo" == y : boolean +>b : boolean +>"foo" == y : boolean +>"foo" : "foo" +>y : "foo" | "bar" + +b = y == "foo"; +>b = y == "foo" : boolean +>b : boolean +>y == "foo" : boolean +>y : "foo" | "bar" +>"foo" : "foo" + +b = "foo" == "bar"; +>b = "foo" == "bar" : boolean +>b : boolean +>"foo" == "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + +b = x != y; +>b = x != y : boolean +>b : boolean +>x != y : boolean +>x : "foo" +>y : "foo" | "bar" + +b = "foo" != y +>b = "foo" != y : boolean +>b : boolean +>"foo" != y : boolean +>"foo" : "foo" +>y : "foo" | "bar" + +b = y != "foo"; +>b = y != "foo" : boolean +>b : boolean +>y != "foo" : boolean +>y : "foo" | "bar" +>"foo" : "foo" + +b = "foo" != "bar"; +>b = "foo" != "bar" : boolean +>b : boolean +>"foo" != "bar" : boolean +>"foo" : "foo" +>"bar" : "bar" + + diff --git a/tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts b/tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts index 4992ec680925e..572eaf9b29082 100644 --- a/tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts +++ b/tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts @@ -75,4 +75,37 @@ function foo(t: T, u: U, v: V) { var rh6 = b != t; var rh7 = b === t; var rh8 = b !== t; -} \ No newline at end of file +} + +function Generic(t: T, b: U, v: V, w: W) { + + // generics with related constraints, ok + var ri1 = b < t; + var ri2 = b > t; + var ri3 = b <= t; + var ri4 = b >= t; + var ri5 = b == t; + var ri6 = b != t; + var ri7 = b === t; + var ri8 = b !== t; + + // generics with constraints that preventing conforming values from matching, error + var rj1 = v < t; + var rj2 = v > t; + var rj3 = v <= t; + var rj4 = v >= t; + var rj5 = v == t; + var rj6 = v != t; + var rj7 = v === t; + var rj8 = v !== t; + + // generics with vs. without constraint, can match, ok + var rk1 = w < t; + var rk2 = w > t; + var rk3 = w <= t; + var rk4 = w >= t; + var rk5 = w == t; + var rk6 = w != t; + var rk7 = w === t; + var rk8 = w !== t; +}