TypeScript/tests/baselines/reference/decrementAndIncrementOperators.errors.txt

65 lines
2 KiB
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/decrementAndIncrementOperators.ts (13 errors) ====
var x = 0;
// errors
1 ++;
~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
(1)++;
~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
(1)--;
~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
++(1);
~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
--(1);
~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
(1 + 2)++;
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
(1 + 2)--;
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
++(1 + 2);
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
--(1 + 2);
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
(x + x)++;
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
(x + x)--;
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
++(x + x);
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
--(x + x);
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
2014-07-13 01:04:16 +02:00
//OK
x++;
x--;
++x;
--x;
(x)++;
--(x);
((x))++;
((x))--;
x[x++]++;