199 lines
3 KiB
Text
199 lines
3 KiB
Text
=== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherType.ts ===
|
|
// ++ operator on any type
|
|
|
|
var ANY: any;
|
|
>ANY : any
|
|
|
|
var ANY1;
|
|
>ANY1 : any
|
|
|
|
var ANY2: any[] = ["", ""];
|
|
>ANY2 : any[]
|
|
>["", ""] : string[]
|
|
>"" : string
|
|
>"" : string
|
|
|
|
var obj = {x:1,y:null};
|
|
>obj : { x: number; y: any; }
|
|
>{x:1,y:null} : { x: number; y: null; }
|
|
>x : number
|
|
>1 : number
|
|
>y : null
|
|
>null : null
|
|
|
|
class A {
|
|
>A : A
|
|
|
|
public a: any;
|
|
>a : any
|
|
}
|
|
module M {
|
|
>M : typeof M
|
|
|
|
export var n: any;
|
|
>n : any
|
|
}
|
|
var objA = new A();
|
|
>objA : A
|
|
>new A() : A
|
|
>A : typeof A
|
|
|
|
// any type var
|
|
var ResultIsNumber1 = ++ANY;
|
|
>ResultIsNumber1 : number
|
|
>++ANY : number
|
|
>ANY : any
|
|
|
|
var ResultIsNumber2 = ++ANY1;
|
|
>ResultIsNumber2 : number
|
|
>++ANY1 : number
|
|
>ANY1 : any
|
|
|
|
var ResultIsNumber3 = ANY1++;
|
|
>ResultIsNumber3 : number
|
|
>ANY1++ : number
|
|
>ANY1 : any
|
|
|
|
var ResultIsNumber4 = ANY1++;
|
|
>ResultIsNumber4 : number
|
|
>ANY1++ : number
|
|
>ANY1 : any
|
|
|
|
// expressions
|
|
var ResultIsNumber5 = ++ANY2[0];
|
|
>ResultIsNumber5 : number
|
|
>++ANY2[0] : number
|
|
>ANY2[0] : any
|
|
>ANY2 : any[]
|
|
>0 : number
|
|
|
|
var ResultIsNumber6 = ++obj.x;
|
|
>ResultIsNumber6 : number
|
|
>++obj.x : number
|
|
>obj.x : number
|
|
>obj : { x: number; y: any; }
|
|
>x : number
|
|
|
|
var ResultIsNumber7 = ++obj.y;
|
|
>ResultIsNumber7 : number
|
|
>++obj.y : number
|
|
>obj.y : any
|
|
>obj : { x: number; y: any; }
|
|
>y : any
|
|
|
|
var ResultIsNumber8 = ++objA.a;
|
|
>ResultIsNumber8 : number
|
|
>++objA.a : number
|
|
>objA.a : any
|
|
>objA : A
|
|
>a : any
|
|
|
|
var ResultIsNumber = ++M.n;
|
|
>ResultIsNumber : number
|
|
>++M.n : number
|
|
>M.n : any
|
|
>M : typeof M
|
|
>n : any
|
|
|
|
var ResultIsNumber9 = ANY2[0]++;
|
|
>ResultIsNumber9 : number
|
|
>ANY2[0]++ : number
|
|
>ANY2[0] : any
|
|
>ANY2 : any[]
|
|
>0 : number
|
|
|
|
var ResultIsNumber10 = obj.x++;
|
|
>ResultIsNumber10 : number
|
|
>obj.x++ : number
|
|
>obj.x : number
|
|
>obj : { x: number; y: any; }
|
|
>x : number
|
|
|
|
var ResultIsNumber11 = obj.y++;
|
|
>ResultIsNumber11 : number
|
|
>obj.y++ : number
|
|
>obj.y : any
|
|
>obj : { x: number; y: any; }
|
|
>y : any
|
|
|
|
var ResultIsNumber12 = objA.a++;
|
|
>ResultIsNumber12 : number
|
|
>objA.a++ : number
|
|
>objA.a : any
|
|
>objA : A
|
|
>a : any
|
|
|
|
var ResultIsNumber13 = M.n++;
|
|
>ResultIsNumber13 : number
|
|
>M.n++ : number
|
|
>M.n : any
|
|
>M : typeof M
|
|
>n : any
|
|
|
|
// miss assignment opertors
|
|
++ANY;
|
|
>++ANY : number
|
|
>ANY : any
|
|
|
|
++ANY1;
|
|
>++ANY1 : number
|
|
>ANY1 : any
|
|
|
|
++ANY2[0];
|
|
>++ANY2[0] : number
|
|
>ANY2[0] : any
|
|
>ANY2 : any[]
|
|
>0 : number
|
|
|
|
++ANY, ++ANY1;
|
|
>++ANY, ++ANY1 : number
|
|
>++ANY : number
|
|
>ANY : any
|
|
>++ANY1 : number
|
|
>ANY1 : any
|
|
|
|
++objA.a;
|
|
>++objA.a : number
|
|
>objA.a : any
|
|
>objA : A
|
|
>a : any
|
|
|
|
++M.n;
|
|
>++M.n : number
|
|
>M.n : any
|
|
>M : typeof M
|
|
>n : any
|
|
|
|
ANY++;
|
|
>ANY++ : number
|
|
>ANY : any
|
|
|
|
ANY1++;
|
|
>ANY1++ : number
|
|
>ANY1 : any
|
|
|
|
ANY2[0]++;
|
|
>ANY2[0]++ : number
|
|
>ANY2[0] : any
|
|
>ANY2 : any[]
|
|
>0 : number
|
|
|
|
ANY++, ANY1++;
|
|
>ANY++, ANY1++ : number
|
|
>ANY++ : number
|
|
>ANY : any
|
|
>ANY1++ : number
|
|
>ANY1 : any
|
|
|
|
objA.a++;
|
|
>objA.a++ : number
|
|
>objA.a : any
|
|
>objA : A
|
|
>a : any
|
|
|
|
M.n++;
|
|
>M.n++ : number
|
|
>M.n : any
|
|
>M : typeof M
|
|
>n : any
|
|
|