95 lines
No EOL
2.8 KiB
Text
95 lines
No EOL
2.8 KiB
Text
==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts (27 errors) ====
|
|
enum E { a, b }
|
|
|
|
var a: void;
|
|
|
|
var x1: boolean;
|
|
x1 += a;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'boolean' and 'void'.
|
|
x1 += true;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'.
|
|
x1 += 0;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'boolean' and 'number'.
|
|
x1 += E.a;
|
|
~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'boolean' and 'E'.
|
|
x1 += {};
|
|
~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'boolean' and '{}'.
|
|
x1 += null;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'.
|
|
x1 += undefined;
|
|
~~~~~~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'boolean' and 'boolean'.
|
|
|
|
var x2: {};
|
|
x2 += a;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types '{}' and 'void'.
|
|
x2 += true;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types '{}' and 'boolean'.
|
|
x2 += 0;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types '{}' and 'number'.
|
|
x2 += E.a;
|
|
~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types '{}' and 'E'.
|
|
x2 += {};
|
|
~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types '{}' and '{}'.
|
|
x2 += null;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types '{}' and '{}'.
|
|
x2 += undefined;
|
|
~~~~~~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types '{}' and '{}'.
|
|
|
|
var x3: void;
|
|
x3 += a;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'void' and 'void'.
|
|
x3 += true;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'void' and 'boolean'.
|
|
x3 += 0;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'void' and 'number'.
|
|
x3 += E.a;
|
|
~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'void' and 'E'.
|
|
x3 += {};
|
|
~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'void' and '{}'.
|
|
x3 += null;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'void' and 'void'.
|
|
x3 += undefined;
|
|
~~~~~~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'void' and 'void'.
|
|
|
|
var x4: number;
|
|
x4 += a;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'number' and 'void'.
|
|
x4 += true;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'number' and 'boolean'.
|
|
x4 += {};
|
|
~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'number' and '{}'.
|
|
|
|
var x5: E;
|
|
x5 += a;
|
|
~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'E' and 'void'.
|
|
x5 += true;
|
|
~~~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'E' and 'boolean'.
|
|
x5 += {};
|
|
~~~~~~~~
|
|
!!! Operator '+=' cannot be applied to types 'E' and '{}'. |