1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
=== 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 : E
a = 10,
>a : E.a
>10 : 10
b = a,
>b : E.a
>a : E.a
c = (a+1),
>c : E.c
>(a+1) : number
>a+1 : number
>a : E.a
>1 : 1
e,
>e : E.e
d = ~e,
>d : E.d
>~e : number
>e : E.e
f = a << 2 >> 1,
>f : E.f
>a << 2 >> 1 : number
>a << 2 : number
>a : E.a
>2 : 2
>1 : 1
g = a << 2 >>> 1,
>g : E.f
>a << 2 >>> 1 : number
>a << 2 : number
>a : E.a
>2 : 2
>1 : 1
h = a | b
>h : E.a
>a | b : number
>a : E.a
>b : E.a
}
|