TypeScript/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt

37 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-11-05 21:26:03 +01:00
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2322: Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2322: Type 'string' is not assignable to type 'E'.
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }'.
Property 'a' is missing in type 'String'.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2322: Type 'string' is not assignable to type 'void'.
2014-07-13 01:04:16 +02:00
==== 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 += '';
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
2014-07-13 01:04:16 +02:00
var x2: number;
x2 += '';
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
var x3: E;
x3 += '';
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'E'.
2014-07-13 01:04:16 +02:00
var x4: {a: string};
x4 += '';
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type '{ a: string; }'.
!!! error TS2322: Property 'a' is missing in type 'String'.
2014-07-13 01:04:16 +02:00
var x5: void;
x5 += '';
~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'void'.