Closed
Description
According to spec:
An expression is considered a constant enum expression if it is one of the following:
....
*** An identifier or property access that denotes a previously declared member in the same constant enum declaration.
....
In the Ambient Enum Declaration,
In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions.
However, compiler reports an error for the following code:
declare enum E {
a = 10,
b = a, // Ambient enum elements can only have integer literal initializers.
e = 10 << 2 * 8, // error as well
}
This is contradict to what it means to be constant enum expression