2014-07-13 01:04:16 +02:00
|
|
|
//// [additionOperatorWithNumberAndEnum.ts]
|
|
|
|
enum E { a, b }
|
2015-01-21 22:55:07 +01:00
|
|
|
enum F { c, d }
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
var a: number;
|
|
|
|
var b: E;
|
2015-01-21 22:55:07 +01:00
|
|
|
var c: E | F;
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
var r1 = a + a;
|
|
|
|
var r2 = a + b;
|
|
|
|
var r3 = b + a;
|
|
|
|
var r4 = b + b;
|
|
|
|
|
|
|
|
var r5 = 0 + a;
|
|
|
|
var r6 = E.a + 0;
|
|
|
|
var r7 = E.a + E.b;
|
2015-01-21 22:55:07 +01:00
|
|
|
var r8 = E['a'] + E['b'];
|
|
|
|
var r9 = E['a'] + F['c'];
|
|
|
|
|
|
|
|
var r10 = a + c;
|
|
|
|
var r11 = c + a;
|
|
|
|
var r12 = b + c;
|
|
|
|
var r13 = c + b;
|
|
|
|
var r14 = c + c;
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
//// [additionOperatorWithNumberAndEnum.js]
|
|
|
|
var E;
|
|
|
|
(function (E) {
|
|
|
|
E[E["a"] = 0] = "a";
|
|
|
|
E[E["b"] = 1] = "b";
|
|
|
|
})(E || (E = {}));
|
2015-01-21 22:55:07 +01:00
|
|
|
var F;
|
|
|
|
(function (F) {
|
|
|
|
F[F["c"] = 0] = "c";
|
|
|
|
F[F["d"] = 1] = "d";
|
|
|
|
})(F || (F = {}));
|
2014-07-13 01:04:16 +02:00
|
|
|
var a;
|
|
|
|
var b;
|
2015-01-21 22:55:07 +01:00
|
|
|
var c;
|
2014-07-13 01:04:16 +02:00
|
|
|
var r1 = a + a;
|
|
|
|
var r2 = a + b;
|
|
|
|
var r3 = b + a;
|
|
|
|
var r4 = b + b;
|
|
|
|
var r5 = 0 + a;
|
|
|
|
var r6 = 0 /* a */ + 0;
|
|
|
|
var r7 = 0 /* a */ + 1 /* b */;
|
2014-11-02 02:16:48 +01:00
|
|
|
var r8 = 0 /* 'a' */ + 1 /* 'b' */;
|
2015-01-21 22:55:07 +01:00
|
|
|
var r9 = 0 /* 'a' */ + 0 /* 'c' */;
|
|
|
|
var r10 = a + c;
|
|
|
|
var r11 = c + a;
|
|
|
|
var r12 = b + c;
|
|
|
|
var r13 = c + b;
|
|
|
|
var r14 = c + c;
|