2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherType.ts ===
|
|
|
|
// -- operator on any type
|
|
|
|
|
|
|
|
var ANY: any;
|
|
|
|
>ANY : any
|
|
|
|
|
|
|
|
var ANY1;
|
|
|
|
>ANY1 : any
|
|
|
|
|
|
|
|
var ANY2: any[] = ["", ""];
|
|
|
|
>ANY2 : any[]
|
2014-10-13 15:56:58 +02:00
|
|
|
>["", ""] : string[]
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var obj = {x:1,y:null};
|
|
|
|
>obj : { x: number; y: any; }
|
|
|
|
>{x:1,y:null} : { x: number; y: null; }
|
|
|
|
>x : number
|
2014-09-10 21:58:30 +02:00
|
|
|
>y : null
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
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[]
|
|
|
|
|
|
|
|
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[]
|
|
|
|
|
|
|
|
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[]
|
|
|
|
|
|
|
|
--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[]
|
|
|
|
|
|
|
|
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
|
|
|
|
|