19 lines
No EOL
306 B
TypeScript
19 lines
No EOL
306 B
TypeScript
// Constant members allow negatives, but not decimals. Also hex literals are allowed
|
|
enum E1 {
|
|
a = 1,
|
|
b
|
|
}
|
|
enum E2 {
|
|
a = - 1,
|
|
b
|
|
}
|
|
enum E3 {
|
|
a = 0.1,
|
|
b // Error because 0.1 is not a constant
|
|
}
|
|
|
|
declare enum E4 {
|
|
a = 1,
|
|
b = -1,
|
|
c = 0.1 // Not a constant
|
|
} |