40 lines
1.2 KiB
Text
40 lines
1.2 KiB
Text
=== tests/cases/conformance/constEnums/constEnum1.ts ===
|
|
|
|
// 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 {
|
|
>E : Symbol(E, Decl(constEnum1.ts, 0, 0))
|
|
|
|
a = 10,
|
|
>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14))
|
|
|
|
b = a,
|
|
>b : Symbol(E.b, Decl(constEnum1.ts, 6, 11))
|
|
>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14))
|
|
|
|
c = (a+1),
|
|
>c : Symbol(E.c, Decl(constEnum1.ts, 7, 10))
|
|
>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14))
|
|
|
|
e,
|
|
>e : Symbol(E.e, Decl(constEnum1.ts, 8, 14))
|
|
|
|
d = ~e,
|
|
>d : Symbol(E.d, Decl(constEnum1.ts, 9, 6))
|
|
>e : Symbol(E.e, Decl(constEnum1.ts, 8, 14))
|
|
|
|
f = a << 2 >> 1,
|
|
>f : Symbol(E.f, Decl(constEnum1.ts, 10, 11))
|
|
>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14))
|
|
|
|
g = a << 2 >>> 1,
|
|
>g : Symbol(E.g, Decl(constEnum1.ts, 11, 20))
|
|
>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14))
|
|
|
|
h = a | b
|
|
>h : Symbol(E.h, Decl(constEnum1.ts, 12, 21))
|
|
>a : Symbol(E.a, Decl(constEnum1.ts, 5, 14))
|
|
>b : Symbol(E.b, Decl(constEnum1.ts, 6, 11))
|
|
}
|