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

16 lines
442 B
TypeScript

// @declaration: true
// An enum declaration that specifies a const modifier is a constant enum declaration.
// In a constant enum declaration, all members must have constant values and
// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression.
const enum E {
a = 10,
b = a,
c = (a+1),
e,
d = ~e,
f = a << 2 >> 1,
g = a << 2 >>> 1,
h = a | b
}