Conflicts: src/compiler/checker.ts src/compiler/types.ts src/services/services.ts tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt tests/baselines/reference/bestCommonTypeOfTuple.types tests/baselines/reference/bestCommonTypeOfTuple2.types tests/baselines/reference/castingTuple.errors.txt tests/baselines/reference/contextualTypeWithTuple.errors.txt tests/baselines/reference/genericCallWithTupleType.errors.txt tests/baselines/reference/indexerWithTuple.types tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt
24 lines
No EOL
1.2 KiB
Text
24 lines
No EOL
1.2 KiB
Text
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.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/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'.
|
|
|
|
|
|
==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts (3 errors) ====
|
|
// -- operator on enum type
|
|
|
|
enum ENUM1 { A, B, "" };
|
|
|
|
// expression
|
|
var ResultIsNumber1 = --ENUM1["A"];
|
|
var ResultIsNumber2 = ENUM1.A--;
|
|
~~~~~~~
|
|
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer.
|
|
|
|
// miss assignment operator
|
|
--ENUM1["A"];
|
|
|
|
ENUM1[A]--;
|
|
~~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
~
|
|
!!! error TS2304: Cannot find name 'A'. |