65 lines
No EOL
1.9 KiB
Text
65 lines
No EOL
1.9 KiB
Text
==== tests/cases/compiler/decrementAndIncrementOperators.ts (13 errors) ====
|
|
var x = 0;
|
|
|
|
// errors
|
|
1 ++;
|
|
~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
(1)++;
|
|
~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
(1)--;
|
|
~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
++(1);
|
|
~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
--(1);
|
|
~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
(1 + 2)++;
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
(1 + 2)--;
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
++(1 + 2);
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
--(1 + 2);
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
(x + x)++;
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
(x + x)--;
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
++(x + x);
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
--(x + x);
|
|
~~~~~~~
|
|
!!! The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
//OK
|
|
x++;
|
|
x--;
|
|
|
|
++x;
|
|
--x;
|
|
|
|
(x)++;
|
|
--(x);
|
|
|
|
((x))++;
|
|
((x))--;
|
|
|
|
x[x++]++;
|
|
|