TypeScript/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt
2014-09-11 16:11:08 -07:00

33 lines
1.5 KiB
Plaintext

==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts (10 errors) ====
// Unary operator -
// operand before -
var NUMBER1 = var NUMBER-; //expect error
~~~
!!! error TS1109: Expression expected.
~
!!! error TS1005: '=' expected.
~
!!! error TS1109: Expression expected.
// invalid expressions
var NUMBER2 = -(null - undefined);
~~~~
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
~~~~~~~~~
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
var NUMBER3 = -(null - null);
~~~~
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
~~~~
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
var NUMBER4 = -(undefined - undefined);
~~~~~~~~~
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
~~~~~~~~~
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
// miss operand
var NUMBER =-;
~
!!! error TS1109: Expression expected.