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

21 lines
1.1 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (2 errors) ====
// ++ operator on enum type
enum ENUM1 { A, B, "" };
// expression
var ResultIsNumber1 = ++ENUM1["B"];
var ResultIsNumber2 = ENUM1.B++;
~~~~~~~
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
// miss assignment operator
++ENUM1["B"];
ENUM1.B++;
~~~~~~~
2014-10-08 20:11:36 +02:00
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.