mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 23:27:56 +03:00
16 lines
442 B
TypeScript
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
|
|||
|
}
|