1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts ===
var ANY: any;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
var STRING: string;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
var OBJECT: Object;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
//The second operand type is any
ANY, ANY;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
BOOLEAN, ANY;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
NUMBER, ANY;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
STRING, ANY;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
OBJECT, ANY;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
//Return type is any
var resultIsAny1 = (ANY, ANY);
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 14, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
var resultIsAny2 = (BOOLEAN, ANY);
>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
var resultIsAny3 = (NUMBER, ANY);
>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
var resultIsAny4 = (STRING, ANY);
>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
var resultIsAny5 = (OBJECT, ANY);
>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
//Literal and expression
var x: any;
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
1, ANY;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
++NUMBER, ANY;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
"string", [null, 1];
"string".charAt(0), [null, 1];
>"string".charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --))
>charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --))
true, x("any");
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
!BOOLEAN, x.doSomeThing();
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
var resultIsAny6 = (1, ANY);
>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 30, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
var resultIsAny7 = (++NUMBER, ANY);
>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
var resultIsAny8 = ("string", null);
>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3))
var resultIsAny9 = ("string".charAt(0), undefined);
>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3))
>"string".charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --))
>charAt : Symbol(String.charAt, Decl(lib.es5.d.ts, --, --))
>undefined : Symbol(undefined)
var resultIsAny10 = (true, x("any"));
>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
var resultIsAny11 = (!BOOLEAN, x.doSomeThing());
>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
|