28 lines
No EOL
873 B
Text
28 lines
No EOL
873 B
Text
tests/cases/conformance/enums/enumConstantMembers.ts(12,5): error TS1061: Enum member must have initializer.
|
|
tests/cases/conformance/enums/enumConstantMembers.ts(18,5): error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
|
|
|
|
==== tests/cases/conformance/enums/enumConstantMembers.ts (2 errors) ====
|
|
// 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
|
|
~
|
|
!!! error TS1061: Enum member must have initializer.
|
|
}
|
|
|
|
declare enum E4 {
|
|
a = 1,
|
|
b = -1,
|
|
c = 0.1 // Not a constant
|
|
~
|
|
!!! error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
} |