|
| 1 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(15,11): error TS2531: Object is possibly 'null'. |
| 2 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(15,18): error TS2531: Object is possibly 'null'. |
| 3 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(16,11): error TS2532: Object is possibly 'undefined'. |
| 4 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(16,23): error TS2532: Object is possibly 'undefined'. |
| 5 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(24,11): error TS2531: Object is possibly 'null'. |
| 6 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(24,18): error TS2531: Object is possibly 'null'. |
| 7 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(25,11): error TS2532: Object is possibly 'undefined'. |
| 8 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(25,23): error TS2532: Object is possibly 'undefined'. |
| 9 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(33,11): error TS2531: Object is possibly 'null'. |
| 10 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(33,19): error TS2531: Object is possibly 'null'. |
| 11 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(34,11): error TS2532: Object is possibly 'undefined'. |
| 12 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(34,24): error TS2532: Object is possibly 'undefined'. |
| 13 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(42,11): error TS2531: Object is possibly 'null'. |
| 14 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(42,19): error TS2531: Object is possibly 'null'. |
| 15 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(43,11): error TS2532: Object is possibly 'undefined'. |
| 16 | +tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts(43,24): error TS2532: Object is possibly 'undefined'. |
| 17 | + |
| 18 | + |
| 19 | +==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts (16 errors) ==== |
| 20 | + enum E { a, b, c } |
| 21 | + |
| 22 | + var a: number; |
| 23 | + var b: boolean; |
| 24 | + var c: string; |
| 25 | + var d: void; |
| 26 | + var e: E; |
| 27 | + |
| 28 | + // operator < |
| 29 | + var ra1 = a < a; |
| 30 | + var ra2 = b < b; |
| 31 | + var ra3 = c < c; |
| 32 | + var ra4 = d < d; |
| 33 | + var ra5 = e < e; |
| 34 | + var ra6 = null < null; |
| 35 | + ~~~~ |
| 36 | +!!! error TS2531: Object is possibly 'null'. |
| 37 | + ~~~~ |
| 38 | +!!! error TS2531: Object is possibly 'null'. |
| 39 | + var ra7 = undefined < undefined; |
| 40 | + ~~~~~~~~~ |
| 41 | +!!! error TS2532: Object is possibly 'undefined'. |
| 42 | + ~~~~~~~~~ |
| 43 | +!!! error TS2532: Object is possibly 'undefined'. |
| 44 | + |
| 45 | + // operator > |
| 46 | + var rb1 = a > a; |
| 47 | + var rb2 = b > b; |
| 48 | + var rb3 = c > c; |
| 49 | + var rb4 = d > d; |
| 50 | + var rb5 = e > e; |
| 51 | + var rb6 = null > null; |
| 52 | + ~~~~ |
| 53 | +!!! error TS2531: Object is possibly 'null'. |
| 54 | + ~~~~ |
| 55 | +!!! error TS2531: Object is possibly 'null'. |
| 56 | + var rb7 = undefined > undefined; |
| 57 | + ~~~~~~~~~ |
| 58 | +!!! error TS2532: Object is possibly 'undefined'. |
| 59 | + ~~~~~~~~~ |
| 60 | +!!! error TS2532: Object is possibly 'undefined'. |
| 61 | + |
| 62 | + // operator <= |
| 63 | + var rc1 = a <= a; |
| 64 | + var rc2 = b <= b; |
| 65 | + var rc3 = c <= c; |
| 66 | + var rc4 = d <= d; |
| 67 | + var rc5 = e <= e; |
| 68 | + var rc6 = null <= null; |
| 69 | + ~~~~ |
| 70 | +!!! error TS2531: Object is possibly 'null'. |
| 71 | + ~~~~ |
| 72 | +!!! error TS2531: Object is possibly 'null'. |
| 73 | + var rc7 = undefined <= undefined; |
| 74 | + ~~~~~~~~~ |
| 75 | +!!! error TS2532: Object is possibly 'undefined'. |
| 76 | + ~~~~~~~~~ |
| 77 | +!!! error TS2532: Object is possibly 'undefined'. |
| 78 | + |
| 79 | + // operator >= |
| 80 | + var rd1 = a >= a; |
| 81 | + var rd2 = b >= b; |
| 82 | + var rd3 = c >= c; |
| 83 | + var rd4 = d >= d; |
| 84 | + var rd5 = e >= e; |
| 85 | + var rd6 = null >= null; |
| 86 | + ~~~~ |
| 87 | +!!! error TS2531: Object is possibly 'null'. |
| 88 | + ~~~~ |
| 89 | +!!! error TS2531: Object is possibly 'null'. |
| 90 | + var rd7 = undefined >= undefined; |
| 91 | + ~~~~~~~~~ |
| 92 | +!!! error TS2532: Object is possibly 'undefined'. |
| 93 | + ~~~~~~~~~ |
| 94 | +!!! error TS2532: Object is possibly 'undefined'. |
| 95 | + |
| 96 | + // operator == |
| 97 | + var re1 = a == a; |
| 98 | + var re2 = b == b; |
| 99 | + var re3 = c == c; |
| 100 | + var re4 = d == d; |
| 101 | + var re5 = e == e; |
| 102 | + var re6 = null == null; |
| 103 | + var re7 = undefined == undefined; |
| 104 | + |
| 105 | + // operator != |
| 106 | + var rf1 = a != a; |
| 107 | + var rf2 = b != b; |
| 108 | + var rf3 = c != c; |
| 109 | + var rf4 = d != d; |
| 110 | + var rf5 = e != e; |
| 111 | + var rf6 = null != null; |
| 112 | + var rf7 = undefined != undefined; |
| 113 | + |
| 114 | + // operator === |
| 115 | + var rg1 = a === a; |
| 116 | + var rg2 = b === b; |
| 117 | + var rg3 = c === c; |
| 118 | + var rg4 = d === d; |
| 119 | + var rg5 = e === e; |
| 120 | + var rg6 = null === null; |
| 121 | + var rg7 = undefined === undefined; |
| 122 | + |
| 123 | + // operator !== |
| 124 | + var rh1 = a !== a; |
| 125 | + var rh2 = b !== b; |
| 126 | + var rh3 = c !== c; |
| 127 | + var rh4 = d !== d; |
| 128 | + var rh5 = e !== e; |
| 129 | + var rh6 = null !== null; |
| 130 | + var rh7 = undefined !== undefined; |
0 commit comments