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

55 lines
3.9 KiB
Plaintext
Raw Normal View History

tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(7,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(8,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(10,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(11,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(14,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(15,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(18,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(19,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(21,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(22,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts (10 errors) ====
// ++ operator on enum type
enum ENUM { };
enum ENUM1 { A, B, "" };
2014-07-13 01:04:16 +02:00
// enum type var
var ResultIsNumber1 = ++ENUM;
~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
var ResultIsNumber2 = ++ENUM1;
~~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
var ResultIsNumber3 = ENUM++;
~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
var ResultIsNumber4 = ENUM1++;
~~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
// enum type expressions
var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]);
~~~~~~~~~~~~~~~~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
var ResultIsNumber6 = (ENUM[1] + ENUM[2])++;
~~~~~~~~~~~~~~~~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
// miss assignment operator
++ENUM;
~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
++ENUM1;
~~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
ENUM++;
~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
2014-07-13 01:04:16 +02:00
ENUM1++;
~~~~~
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.