mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
94 lines
1.3 KiB
TypeScript
94 lines
1.3 KiB
TypeScript
//// [tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts] ////
|
|
|
|
//// [compoundAdditionAssignmentLHSCanBeAssigned.ts]
|
|
enum E { a, b }
|
|
|
|
declare var a: any;
|
|
declare var b: void;
|
|
|
|
declare var x1: any;
|
|
x1 += a;
|
|
x1 += b;
|
|
x1 += true;
|
|
x1 += 0;
|
|
x1 += '';
|
|
x1 += E.a;
|
|
x1 += {};
|
|
x1 += null;
|
|
x1 += undefined;
|
|
|
|
declare var x2: string;
|
|
x2 += a;
|
|
x2 += b;
|
|
x2 += true;
|
|
x2 += 0;
|
|
x2 += '';
|
|
x2 += E.a;
|
|
x2 += {};
|
|
x2 += null;
|
|
x2 += undefined;
|
|
|
|
declare var x3: number;
|
|
x3 += a;
|
|
x3 += 0;
|
|
x3 += E.a;
|
|
x3 += null;
|
|
x3 += undefined;
|
|
|
|
declare var x4: E;
|
|
x4 += a;
|
|
x4 += 0;
|
|
x4 += E.a;
|
|
x4 += null;
|
|
x4 += undefined;
|
|
|
|
declare var x5: boolean;
|
|
x5 += a;
|
|
|
|
declare var x6: {};
|
|
x6 += a;
|
|
x6 += '';
|
|
|
|
declare var x7: void;
|
|
x7 += a;
|
|
|
|
//// [compoundAdditionAssignmentLHSCanBeAssigned.js]
|
|
"use strict";
|
|
var E;
|
|
(function (E) {
|
|
E[E["a"] = 0] = "a";
|
|
E[E["b"] = 1] = "b";
|
|
})(E || (E = {}));
|
|
x1 += a;
|
|
x1 += b;
|
|
x1 += true;
|
|
x1 += 0;
|
|
x1 += '';
|
|
x1 += E.a;
|
|
x1 += {};
|
|
x1 += null;
|
|
x1 += undefined;
|
|
x2 += a;
|
|
x2 += b;
|
|
x2 += true;
|
|
x2 += 0;
|
|
x2 += '';
|
|
x2 += E.a;
|
|
x2 += {};
|
|
x2 += null;
|
|
x2 += undefined;
|
|
x3 += a;
|
|
x3 += 0;
|
|
x3 += E.a;
|
|
x3 += null;
|
|
x3 += undefined;
|
|
x4 += a;
|
|
x4 += 0;
|
|
x4 += E.a;
|
|
x4 += null;
|
|
x4 += undefined;
|
|
x5 += a;
|
|
x6 += a;
|
|
x6 += '';
|
|
x7 += a;
|