TypeScript/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt
2014-07-12 17:30:19 -07:00

29 lines
810 B
Plaintext

==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts (5 errors) ====
// string can add every type, and result string cannot be assigned to below types
enum E { a, b, c }
var x1: boolean;
x1 += '';
~~
!!! Type 'string' is not assignable to type 'boolean'.
var x2: number;
x2 += '';
~~
!!! Type 'string' is not assignable to type 'number'.
var x3: E;
x3 += '';
~~
!!! Type 'string' is not assignable to type 'E'.
var x4: {a: string};
x4 += '';
~~
!!! Type 'string' is not assignable to type '{ a: string; }':
!!! Property 'a' is missing in type 'String'.
var x5: void;
x5 += '';
~~
!!! Type 'string' is not assignable to type 'void'.