39 lines
1.7 KiB
Plaintext
39 lines
1.7 KiB
Plaintext
==== tests/cases/compiler/arithAssignTyping.ts (12 errors) ====
|
|
class f { }
|
|
|
|
f += ''; // error
|
|
~
|
|
!!! error TS2364: Invalid left-hand side of assignment expression.
|
|
f += 1; // error
|
|
~~~~~~
|
|
!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'.
|
|
f -= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f *= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f /= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f %= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f &= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f |= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f <<= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f >>= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f >>>= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
|
f ^= 1; // error
|
|
~
|
|
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. |