374 lines
4.9 KiB
Text
374 lines
4.9 KiB
Text
=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeEnumAndNumber.ts ===
|
|
enum E { a, b, c }
|
|
>E : E
|
|
>a : E
|
|
>b : E
|
|
>c : E
|
|
|
|
var a: E;
|
|
>a : E
|
|
>E : E
|
|
|
|
var b: number;
|
|
>b : number
|
|
|
|
// operator <
|
|
var ra1 = a < b;
|
|
>ra1 : boolean
|
|
>a < b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var ra2 = b < a;
|
|
>ra2 : boolean
|
|
>b < a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var ra3 = E.a < b;
|
|
>ra3 : boolean
|
|
>E.a < b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var ra4 = b < E.a;
|
|
>ra4 : boolean
|
|
>b < E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var ra5 = E.a < 0;
|
|
>ra5 : boolean
|
|
>E.a < 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var ra6 = 0 < E.a;
|
|
>ra6 : boolean
|
|
>0 < E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
// operator >
|
|
var rb1 = a > b;
|
|
>rb1 : boolean
|
|
>a > b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var rb2 = b > a;
|
|
>rb2 : boolean
|
|
>b > a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var rb3 = E.a > b;
|
|
>rb3 : boolean
|
|
>E.a > b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var rb4 = b > E.a;
|
|
>rb4 : boolean
|
|
>b > E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var rb5 = E.a > 0;
|
|
>rb5 : boolean
|
|
>E.a > 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var rb6 = 0 > E.a;
|
|
>rb6 : boolean
|
|
>0 > E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
// operator <=
|
|
var rc1 = a <= b;
|
|
>rc1 : boolean
|
|
>a <= b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var rc2 = b <= a;
|
|
>rc2 : boolean
|
|
>b <= a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var rc3 = E.a <= b;
|
|
>rc3 : boolean
|
|
>E.a <= b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var rc4 = b <= E.a;
|
|
>rc4 : boolean
|
|
>b <= E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var rc5 = E.a <= 0;
|
|
>rc5 : boolean
|
|
>E.a <= 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var rc6 = 0 <= E.a;
|
|
>rc6 : boolean
|
|
>0 <= E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
// operator >=
|
|
var rd1 = a >= b;
|
|
>rd1 : boolean
|
|
>a >= b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var rd2 = b >= a;
|
|
>rd2 : boolean
|
|
>b >= a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var rd3 = E.a >= b;
|
|
>rd3 : boolean
|
|
>E.a >= b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var rd4 = b >= E.a;
|
|
>rd4 : boolean
|
|
>b >= E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var rd5 = E.a >= 0;
|
|
>rd5 : boolean
|
|
>E.a >= 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var rd6 = 0 >= E.a;
|
|
>rd6 : boolean
|
|
>0 >= E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
// operator ==
|
|
var re1 = a == b;
|
|
>re1 : boolean
|
|
>a == b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var re2 = b == a;
|
|
>re2 : boolean
|
|
>b == a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var re3 = E.a == b;
|
|
>re3 : boolean
|
|
>E.a == b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var re4 = b == E.a;
|
|
>re4 : boolean
|
|
>b == E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var re5 = E.a == 0;
|
|
>re5 : boolean
|
|
>E.a == 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var re6 = 0 == E.a;
|
|
>re6 : boolean
|
|
>0 == E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
// operator !=
|
|
var rf1 = a != b;
|
|
>rf1 : boolean
|
|
>a != b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var rf2 = b != a;
|
|
>rf2 : boolean
|
|
>b != a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var rf3 = E.a != b;
|
|
>rf3 : boolean
|
|
>E.a != b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var rf4 = b != E.a;
|
|
>rf4 : boolean
|
|
>b != E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var rf5 = E.a != 0;
|
|
>rf5 : boolean
|
|
>E.a != 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var rf6 = 0 != E.a;
|
|
>rf6 : boolean
|
|
>0 != E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
// operator ===
|
|
var rg1 = a === b;
|
|
>rg1 : boolean
|
|
>a === b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var rg2 = b === a;
|
|
>rg2 : boolean
|
|
>b === a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var rg3 = E.a === b;
|
|
>rg3 : boolean
|
|
>E.a === b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var rg4 = b === E.a;
|
|
>rg4 : boolean
|
|
>b === E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var rg5 = E.a === 0;
|
|
>rg5 : boolean
|
|
>E.a === 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var rg6 = 0 === E.a;
|
|
>rg6 : boolean
|
|
>0 === E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
// operator !==
|
|
var rh1 = a !== b;
|
|
>rh1 : boolean
|
|
>a !== b : boolean
|
|
>a : E
|
|
>b : number
|
|
|
|
var rh2 = b !== a;
|
|
>rh2 : boolean
|
|
>b !== a : boolean
|
|
>b : number
|
|
>a : E
|
|
|
|
var rh3 = E.a !== b;
|
|
>rh3 : boolean
|
|
>E.a !== b : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>b : number
|
|
|
|
var rh4 = b !== E.a;
|
|
>rh4 : boolean
|
|
>b !== E.a : boolean
|
|
>b : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|
|
var rh5 = E.a !== 0;
|
|
>rh5 : boolean
|
|
>E.a !== 0 : boolean
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
>0 : number
|
|
|
|
var rh6 = 0 !== E.a;
|
|
>rh6 : boolean
|
|
>0 !== E.a : boolean
|
|
>0 : number
|
|
>E.a : E
|
|
>E : typeof E
|
|
>a : E
|
|
|