You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
declareenumE{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
The text was updated successfully, but these errors were encountered:
yuit
added
the
Spec
Issues related to the TypeScript language specification
label
Apr 16, 2015
…number expression). fixesmicrosoft#2790
If an invalid enum constant expression is found, continue incrementing with the last valid initialized value.
If an enum expression references another enum member, then emit a reference to the other value.
…number expression). fixesmicrosoft#2790
If an invalid enum constant expression is found, continue incrementing with the last valid initialized value.
If an enum expression references another enum member, then emit a reference to the other value.
According to spec:
In the Ambient Enum Declaration,
However, compiler reports an error for the following code:
This is contradict to what it means to be constant enum expression
The text was updated successfully, but these errors were encountered: