131 lines
1.6 KiB
Text
131 lines
1.6 KiB
Text
|
=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts ===
|
||
|
interface I {
|
||
|
>I : I
|
||
|
|
||
|
a: string;
|
||
|
>a : string
|
||
|
|
||
|
b?: number;
|
||
|
>b : number
|
||
|
}
|
||
|
|
||
|
interface J {
|
||
|
>J : J
|
||
|
|
||
|
a: string;
|
||
|
>a : string
|
||
|
}
|
||
|
|
||
|
var a: I;
|
||
|
>a : I
|
||
|
>I : I
|
||
|
|
||
|
var b: J;
|
||
|
>b : J
|
||
|
>J : J
|
||
|
|
||
|
// operator <
|
||
|
var ra1 = a < b;
|
||
|
>ra1 : boolean
|
||
|
>a < b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var ra2 = b < a;
|
||
|
>ra2 : boolean
|
||
|
>b < a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|
||
|
// operator >
|
||
|
var rb1 = a > b;
|
||
|
>rb1 : boolean
|
||
|
>a > b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var rb2 = b > a;
|
||
|
>rb2 : boolean
|
||
|
>b > a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|
||
|
// operator <=
|
||
|
var rc1 = a <= b;
|
||
|
>rc1 : boolean
|
||
|
>a <= b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var rc2 = b <= a;
|
||
|
>rc2 : boolean
|
||
|
>b <= a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|
||
|
// operator >=
|
||
|
var rd1 = a >= b;
|
||
|
>rd1 : boolean
|
||
|
>a >= b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var rd2 = b >= a;
|
||
|
>rd2 : boolean
|
||
|
>b >= a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|
||
|
// operator ==
|
||
|
var re1 = a == b;
|
||
|
>re1 : boolean
|
||
|
>a == b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var re2 = b == a;
|
||
|
>re2 : boolean
|
||
|
>b == a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|
||
|
// operator !=
|
||
|
var rf1 = a != b;
|
||
|
>rf1 : boolean
|
||
|
>a != b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var rf2 = b != a;
|
||
|
>rf2 : boolean
|
||
|
>b != a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|
||
|
// operator ===
|
||
|
var rg1 = a === b;
|
||
|
>rg1 : boolean
|
||
|
>a === b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var rg2 = b === a;
|
||
|
>rg2 : boolean
|
||
|
>b === a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|
||
|
// operator !==
|
||
|
var rh1 = a !== b;
|
||
|
>rh1 : boolean
|
||
|
>a !== b : boolean
|
||
|
>a : I
|
||
|
>b : J
|
||
|
|
||
|
var rh2 = b !== a;
|
||
|
>rh2 : boolean
|
||
|
>b !== a : boolean
|
||
|
>b : J
|
||
|
>a : I
|
||
|
|