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 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
=== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts ===
// ++ operator on any type
var ANY1: any;
>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 1, 3))
var ANY2: any[] = [1, 2];
>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 2, 3))
var obj: () => {}
>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 4, 3))
var obj1 = { x: "", y: () => { } };
>obj1 : Symbol(obj1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 3))
>x : Symbol(x, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 12))
>y : Symbol(y, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 19))
function foo(): any {
>foo : Symbol(foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 35))
var a;
>a : Symbol(a, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 7, 7))
return a;
>a : Symbol(a, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 7, 7))
}
class A {
>A : Symbol(A, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 9, 1))
public a: any;
>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 10, 9))
static foo(): any {
>foo : Symbol(A.foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 11, 18))
var a;
>a : Symbol(a, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 13, 11))
return a;
>a : Symbol(a, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 13, 11))
}
}
module M {
>M : Symbol(M, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 16, 1))
export var n: any;
>n : Symbol(n, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 18, 14))
}
var objA = new A();
>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 20, 3))
>A : Symbol(A, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 9, 1))
// any type var
var ResultIsNumber1 = ++ANY2;
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 23, 3))
>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 2, 3))
var ResultIsNumber2 = ++A;
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 24, 3))
>A : Symbol(A, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 9, 1))
var ResultIsNumber3 = ++M;
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 25, 3))
>M : Symbol(M, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 16, 1))
var ResultIsNumber4 = ++obj;
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 26, 3))
>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 4, 3))
var ResultIsNumber5 = ++obj1;
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 27, 3))
>obj1 : Symbol(obj1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 3))
var ResultIsNumber6 = ANY2++;
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 29, 3))
>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 2, 3))
var ResultIsNumber7 = A++;
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 30, 3))
>A : Symbol(A, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 9, 1))
var ResultIsNumber8 = M++;
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 31, 3))
>M : Symbol(M, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 16, 1))
var ResultIsNumber9 = obj++;
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 32, 3))
>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 4, 3))
var ResultIsNumber10 = obj1++;
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 33, 3))
>obj1 : Symbol(obj1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 3))
// any type literal
var ResultIsNumber11 = ++{};
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 36, 3))
var ResultIsNumber12 = ++null;
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 37, 3))
var ResultIsNumber13 = ++undefined;
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 38, 3))
>undefined : Symbol(undefined)
var ResultIsNumber14 = null++;
>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 40, 3))
var ResultIsNumber15 = {}++;
>ResultIsNumber15 : Symbol(ResultIsNumber15, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 41, 3))
var ResultIsNumber16 = undefined++;
>ResultIsNumber16 : Symbol(ResultIsNumber16, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 42, 3))
>undefined : Symbol(undefined)
// any type expressions
var ResultIsNumber17 = ++foo();
>ResultIsNumber17 : Symbol(ResultIsNumber17, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 45, 3))
>foo : Symbol(foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 35))
var ResultIsNumber18 = ++A.foo();
>ResultIsNumber18 : Symbol(ResultIsNumber18, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 46, 3))
>A.foo : Symbol(A.foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 11, 18))
>A : Symbol(A, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 9, 1))
>foo : Symbol(A.foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 11, 18))
var ResultIsNumber19 = ++(null + undefined);
>ResultIsNumber19 : Symbol(ResultIsNumber19, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 47, 3))
>undefined : Symbol(undefined)
var ResultIsNumber20 = ++(null + null);
>ResultIsNumber20 : Symbol(ResultIsNumber20, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 48, 3))
var ResultIsNumber21 = ++(undefined + undefined);
>ResultIsNumber21 : Symbol(ResultIsNumber21, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 49, 3))
>undefined : Symbol(undefined)
>undefined : Symbol(undefined)
var ResultIsNumber22 = ++obj1.x;
>ResultIsNumber22 : Symbol(ResultIsNumber22, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 50, 3))
>obj1.x : Symbol(x, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 12))
>obj1 : Symbol(obj1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 3))
>x : Symbol(x, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 12))
var ResultIsNumber23 = ++obj1.y;
>ResultIsNumber23 : Symbol(ResultIsNumber23, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 51, 3))
>obj1.y : Symbol(y, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 19))
>obj1 : Symbol(obj1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 3))
>y : Symbol(y, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 19))
var ResultIsNumber24 = foo()++;
>ResultIsNumber24 : Symbol(ResultIsNumber24, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 53, 3))
>foo : Symbol(foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 35))
var ResultIsNumber25 = A.foo()++;
>ResultIsNumber25 : Symbol(ResultIsNumber25, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 54, 3))
>A.foo : Symbol(A.foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 11, 18))
>A : Symbol(A, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 9, 1))
>foo : Symbol(A.foo, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 11, 18))
var ResultIsNumber26 = (null + undefined)++;
>ResultIsNumber26 : Symbol(ResultIsNumber26, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 55, 3))
>undefined : Symbol(undefined)
var ResultIsNumber27 = (null + null)++;
>ResultIsNumber27 : Symbol(ResultIsNumber27, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 56, 3))
var ResultIsNumber28 = (undefined + undefined)++;
>ResultIsNumber28 : Symbol(ResultIsNumber28, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 57, 3))
>undefined : Symbol(undefined)
>undefined : Symbol(undefined)
var ResultIsNumber29 = obj1.x++;
>ResultIsNumber29 : Symbol(ResultIsNumber29, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 58, 3))
>obj1.x : Symbol(x, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 12))
>obj1 : Symbol(obj1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 3))
>x : Symbol(x, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 12))
var ResultIsNumber30 = obj1.y++;
>ResultIsNumber30 : Symbol(ResultIsNumber30, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 59, 3))
>obj1.y : Symbol(y, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 19))
>obj1 : Symbol(obj1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 3))
>y : Symbol(y, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 5, 19))
// miss assignment operators
++ANY2;
>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 2, 3))
ANY2++;
>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 2, 3))
++ANY1++;
>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 1, 3))
++ANY2++;
>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 2, 3))
++ANY2[0]++;
>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherTypeInvalidOperations.ts, 2, 3))
|