swc/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithEnum.ts

24 lines
378 B
TypeScript

// operands of an enum type are treated as having the primitive type Number.
enum E {
a,
b
}
var a: any;
var b: number;
var c: E;
// operator **
var r1 = c ** a;
var r2 = c ** b;
var r3 = c ** c;
var r4 = a ** c;
var r5 = b ** c;
var r6 = E.a ** a;
var r7 = E.a ** b;
var r8 = E.a ** E.b;
var r9 = E.a ** 1;
var r10 = a ** E.b;
var r11 = b ** E.b;
var r12 = 1 ** E.b;