165 lines
3 KiB
Text
165 lines
3 KiB
Text
|
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts ===
|
||
|
var ANY: any;
|
||
|
>ANY : any
|
||
|
|
||
|
var BOOLEAN: boolean;
|
||
|
>BOOLEAN : boolean
|
||
|
|
||
|
var NUMBER: number;
|
||
|
>NUMBER : number
|
||
|
|
||
|
var STRING: string;
|
||
|
>STRING : string
|
||
|
|
||
|
var OBJECT: Object;
|
||
|
>OBJECT : Object
|
||
|
>Object : Object
|
||
|
|
||
|
//The second operand type is any
|
||
|
ANY, ANY;
|
||
|
>ANY, ANY : any
|
||
|
>ANY : any
|
||
|
>ANY : any
|
||
|
|
||
|
BOOLEAN, ANY;
|
||
|
>BOOLEAN, ANY : any
|
||
|
>BOOLEAN : boolean
|
||
|
>ANY : any
|
||
|
|
||
|
NUMBER, ANY;
|
||
|
>NUMBER, ANY : any
|
||
|
>NUMBER : number
|
||
|
>ANY : any
|
||
|
|
||
|
STRING, ANY;
|
||
|
>STRING, ANY : any
|
||
|
>STRING : string
|
||
|
>ANY : any
|
||
|
|
||
|
OBJECT, ANY;
|
||
|
>OBJECT, ANY : any
|
||
|
>OBJECT : Object
|
||
|
>ANY : any
|
||
|
|
||
|
//Return type is any
|
||
|
var resultIsAny1 = (ANY, ANY);
|
||
|
>resultIsAny1 : any
|
||
|
>(ANY, ANY) : any
|
||
|
>ANY, ANY : any
|
||
|
>ANY : any
|
||
|
>ANY : any
|
||
|
|
||
|
var resultIsAny2 = (BOOLEAN, ANY);
|
||
|
>resultIsAny2 : any
|
||
|
>(BOOLEAN, ANY) : any
|
||
|
>BOOLEAN, ANY : any
|
||
|
>BOOLEAN : boolean
|
||
|
>ANY : any
|
||
|
|
||
|
var resultIsAny3 = (NUMBER, ANY);
|
||
|
>resultIsAny3 : any
|
||
|
>(NUMBER, ANY) : any
|
||
|
>NUMBER, ANY : any
|
||
|
>NUMBER : number
|
||
|
>ANY : any
|
||
|
|
||
|
var resultIsAny4 = (STRING, ANY);
|
||
|
>resultIsAny4 : any
|
||
|
>(STRING, ANY) : any
|
||
|
>STRING, ANY : any
|
||
|
>STRING : string
|
||
|
>ANY : any
|
||
|
|
||
|
var resultIsAny5 = (OBJECT, ANY);
|
||
|
>resultIsAny5 : any
|
||
|
>(OBJECT, ANY) : any
|
||
|
>OBJECT, ANY : any
|
||
|
>OBJECT : Object
|
||
|
>ANY : any
|
||
|
|
||
|
//Literal and expression
|
||
|
var x: any;
|
||
|
>x : any
|
||
|
|
||
|
1, ANY;
|
||
|
>1, ANY : any
|
||
|
>ANY : any
|
||
|
|
||
|
++NUMBER, ANY;
|
||
|
>++NUMBER, ANY : any
|
||
|
>++NUMBER : number
|
||
|
>NUMBER : number
|
||
|
>ANY : any
|
||
|
|
||
|
"string", [null, 1];
|
||
|
>"string", [null, 1] : number[]
|
||
|
>[null, 1] : number[]
|
||
|
|
||
|
"string".charAt(0), [null, 1];
|
||
|
>"string".charAt(0), [null, 1] : number[]
|
||
|
>"string".charAt(0) : string
|
||
|
>"string".charAt : (pos: number) => string
|
||
|
>charAt : (pos: number) => string
|
||
|
>[null, 1] : number[]
|
||
|
|
||
|
true, x("any");
|
||
|
>true, x("any") : any
|
||
|
>x("any") : any
|
||
|
>x : any
|
||
|
|
||
|
!BOOLEAN, x.doSomeThing();
|
||
|
>!BOOLEAN, x.doSomeThing() : any
|
||
|
>!BOOLEAN : boolean
|
||
|
>BOOLEAN : boolean
|
||
|
>x.doSomeThing() : any
|
||
|
>x.doSomeThing : any
|
||
|
>x : any
|
||
|
>doSomeThing : any
|
||
|
|
||
|
var resultIsAny6 = (1, ANY);
|
||
|
>resultIsAny6 : any
|
||
|
>(1, ANY) : any
|
||
|
>1, ANY : any
|
||
|
>ANY : any
|
||
|
|
||
|
var resultIsAny7 = (++NUMBER, ANY);
|
||
|
>resultIsAny7 : any
|
||
|
>(++NUMBER, ANY) : any
|
||
|
>++NUMBER, ANY : any
|
||
|
>++NUMBER : number
|
||
|
>NUMBER : number
|
||
|
>ANY : any
|
||
|
|
||
|
var resultIsAny8 = ("string", null);
|
||
|
>resultIsAny8 : any
|
||
|
>("string", null) : null
|
||
|
>"string", null : null
|
||
|
|
||
|
var resultIsAny9 = ("string".charAt(0), undefined);
|
||
|
>resultIsAny9 : any
|
||
|
>("string".charAt(0), undefined) : undefined
|
||
|
>"string".charAt(0), undefined : undefined
|
||
|
>"string".charAt(0) : string
|
||
|
>"string".charAt : (pos: number) => string
|
||
|
>charAt : (pos: number) => string
|
||
|
>undefined : undefined
|
||
|
|
||
|
var resultIsAny10 = (true, x("any"));
|
||
|
>resultIsAny10 : any
|
||
|
>(true, x("any")) : any
|
||
|
>true, x("any") : any
|
||
|
>x("any") : any
|
||
|
>x : any
|
||
|
|
||
|
var resultIsAny11 = (!BOOLEAN, x.doSomeThing());
|
||
|
>resultIsAny11 : any
|
||
|
>(!BOOLEAN, x.doSomeThing()) : any
|
||
|
>!BOOLEAN, x.doSomeThing() : any
|
||
|
>!BOOLEAN : boolean
|
||
|
>BOOLEAN : boolean
|
||
|
>x.doSomeThing() : any
|
||
|
>x.doSomeThing : any
|
||
|
>x : any
|
||
|
>doSomeThing : any
|
||
|
|