143 lines
No EOL
4.7 KiB
Text
143 lines
No EOL
4.7 KiB
Text
==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTypeParameter.ts (32 errors) ====
|
|
var a: {};
|
|
var b: Object;
|
|
|
|
function foo<T, U/* extends T*/, V/* extends U*/>(t: T, u: U, v: V) {
|
|
// errors
|
|
var ra1 = t < u;
|
|
~~~~~
|
|
!!! Operator '<' cannot be applied to types 'T' and 'U'.
|
|
var ra2 = t > u;
|
|
~~~~~
|
|
!!! Operator '>' cannot be applied to types 'T' and 'U'.
|
|
var ra3 = t <= u;
|
|
~~~~~~
|
|
!!! Operator '<=' cannot be applied to types 'T' and 'U'.
|
|
var ra4 = t >= u;
|
|
~~~~~~
|
|
!!! Operator '>=' cannot be applied to types 'T' and 'U'.
|
|
var ra5 = t == u;
|
|
~~~~~~
|
|
!!! Operator '==' cannot be applied to types 'T' and 'U'.
|
|
var ra6 = t != u;
|
|
~~~~~~
|
|
!!! Operator '!=' cannot be applied to types 'T' and 'U'.
|
|
var ra7 = t === u;
|
|
~~~~~~~
|
|
!!! Operator '===' cannot be applied to types 'T' and 'U'.
|
|
var ra8 = t !== u;
|
|
~~~~~~~
|
|
!!! Operator '!==' cannot be applied to types 'T' and 'U'.
|
|
|
|
var rb1 = u < t;
|
|
~~~~~
|
|
!!! Operator '<' cannot be applied to types 'U' and 'T'.
|
|
var rb2 = u > t;
|
|
~~~~~
|
|
!!! Operator '>' cannot be applied to types 'U' and 'T'.
|
|
var rb3 = u <= t;
|
|
~~~~~~
|
|
!!! Operator '<=' cannot be applied to types 'U' and 'T'.
|
|
var rb4 = u >= t;
|
|
~~~~~~
|
|
!!! Operator '>=' cannot be applied to types 'U' and 'T'.
|
|
var rb5 = u == t;
|
|
~~~~~~
|
|
!!! Operator '==' cannot be applied to types 'U' and 'T'.
|
|
var rb6 = u != t;
|
|
~~~~~~
|
|
!!! Operator '!=' cannot be applied to types 'U' and 'T'.
|
|
var rb7 = u === t;
|
|
~~~~~~~
|
|
!!! Operator '===' cannot be applied to types 'U' and 'T'.
|
|
var rb8 = u !== t;
|
|
~~~~~~~
|
|
!!! Operator '!==' cannot be applied to types 'U' and 'T'.
|
|
|
|
var rc1 = t < v;
|
|
~~~~~
|
|
!!! Operator '<' cannot be applied to types 'T' and 'V'.
|
|
var rc2 = t > v;
|
|
~~~~~
|
|
!!! Operator '>' cannot be applied to types 'T' and 'V'.
|
|
var rc3 = t <= v;
|
|
~~~~~~
|
|
!!! Operator '<=' cannot be applied to types 'T' and 'V'.
|
|
var rc4 = t >= v;
|
|
~~~~~~
|
|
!!! Operator '>=' cannot be applied to types 'T' and 'V'.
|
|
var rc5 = t == v;
|
|
~~~~~~
|
|
!!! Operator '==' cannot be applied to types 'T' and 'V'.
|
|
var rc6 = t != v;
|
|
~~~~~~
|
|
!!! Operator '!=' cannot be applied to types 'T' and 'V'.
|
|
var rc7 = t === v;
|
|
~~~~~~~
|
|
!!! Operator '===' cannot be applied to types 'T' and 'V'.
|
|
var rc8 = t !== v;
|
|
~~~~~~~
|
|
!!! Operator '!==' cannot be applied to types 'T' and 'V'.
|
|
|
|
var rd1 = v < t;
|
|
~~~~~
|
|
!!! Operator '<' cannot be applied to types 'V' and 'T'.
|
|
var rd2 = v > t;
|
|
~~~~~
|
|
!!! Operator '>' cannot be applied to types 'V' and 'T'.
|
|
var rd3 = v <= t;
|
|
~~~~~~
|
|
!!! Operator '<=' cannot be applied to types 'V' and 'T'.
|
|
var rd4 = v >= t;
|
|
~~~~~~
|
|
!!! Operator '>=' cannot be applied to types 'V' and 'T'.
|
|
var rd5 = v == t;
|
|
~~~~~~
|
|
!!! Operator '==' cannot be applied to types 'V' and 'T'.
|
|
var rd6 = v != t;
|
|
~~~~~~
|
|
!!! Operator '!=' cannot be applied to types 'V' and 'T'.
|
|
var rd7 = v === t;
|
|
~~~~~~~
|
|
!!! Operator '===' cannot be applied to types 'V' and 'T'.
|
|
var rd8 = v !== t;
|
|
~~~~~~~
|
|
!!! Operator '!==' cannot be applied to types 'V' and 'T'.
|
|
|
|
// ok
|
|
var re1 = t < a;
|
|
var re2 = t > a;
|
|
var re3 = t <= a;
|
|
var re4 = t >= a;
|
|
var re5 = t == a;
|
|
var re6 = t != a;
|
|
var re7 = t === a;
|
|
var re8 = t !== a;
|
|
|
|
var rf1 = a < t;
|
|
var rf2 = a > t;
|
|
var rf3 = a <= t;
|
|
var rf4 = a >= t;
|
|
var rf5 = a == t;
|
|
var rf6 = a != t;
|
|
var rf7 = a === t;
|
|
var rf8 = a !== t;
|
|
|
|
var rg1 = t < b;
|
|
var rg2 = t > b;
|
|
var rg3 = t <= b;
|
|
var rg4 = t >= b;
|
|
var rg5 = t == b;
|
|
var rg6 = t != b;
|
|
var rg7 = t === b;
|
|
var rg8 = t !== b;
|
|
|
|
var rh1 = b < t;
|
|
var rh2 = b > t;
|
|
var rh3 = b <= t;
|
|
var rh4 = b >= t;
|
|
var rh5 = b == t;
|
|
var rh6 = b != t;
|
|
var rh7 = b === t;
|
|
var rh8 = b !== t;
|
|
} |