144 lines
No EOL
11 KiB
Text
144 lines
No EOL
11 KiB
Text
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(17,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(19,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(22,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(23,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(26,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(27,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(28,23): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(31,25): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(32,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(33,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(34,26): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(36,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(37,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(38,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(39,24): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(42,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(43,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(44,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(45,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(46,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(47,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(49,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(50,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(51,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(52,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(53,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(54,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts(54,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
|
|
==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithUnsupportedBooleanType.ts (29 errors) ====
|
|
// -- operator on boolean type
|
|
var BOOLEAN: boolean;
|
|
|
|
function foo(): boolean { return true; }
|
|
|
|
class A {
|
|
public a: boolean;
|
|
static foo() { return true; }
|
|
}
|
|
module M {
|
|
export var n: boolean;
|
|
}
|
|
|
|
var objA = new A();
|
|
|
|
// boolean type var
|
|
var ResultIsNumber1 = --BOOLEAN;
|
|
~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
var ResultIsNumber2 = BOOLEAN--;
|
|
~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
// boolean type literal
|
|
var ResultIsNumber3 = --true;
|
|
~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber4 = --{ x: true, y: false };
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber5 = --{ x: true, y: (n: boolean) => { return n; } };
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
var ResultIsNumber6 = true--;
|
|
~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber7 = { x: true, y: false }--;
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber8 = { x: true, y: (n: boolean) => { return n; } }--;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
// boolean type expressions
|
|
var ResultIsNumber9 = --objA.a;
|
|
~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber10 = --M.n;
|
|
~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber11 = --foo();
|
|
~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber12 = --A.foo();
|
|
~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
var ResultIsNumber13 = foo()--;
|
|
~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber14 = A.foo()--;
|
|
~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber15 = objA.a--;
|
|
~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
var ResultIsNumber16 = M.n--;
|
|
~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
// miss assignment operators
|
|
--true;
|
|
~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
--BOOLEAN;
|
|
~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
--foo();
|
|
~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
--objA.a;
|
|
~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
--M.n;
|
|
~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
--objA.a, M.n;
|
|
~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
|
|
true--;
|
|
~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
BOOLEAN--;
|
|
~~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
foo()--;
|
|
~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
objA.a--;
|
|
~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
M.n--;
|
|
~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
objA.a--, M.n--;
|
|
~~~~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
|
~~~
|
|
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. |