24 lines
No EOL
1.3 KiB
Text
24 lines
No EOL
1.3 KiB
Text
tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(5,5): error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(6,5): error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(7,5): error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
tests/cases/conformance/ambient/ambientEnumDeclaration1.ts(8,5): error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
|
|
|
|
==== tests/cases/conformance/ambient/ambientEnumDeclaration1.ts (4 errors) ====
|
|
// In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions.
|
|
|
|
declare enum E {
|
|
a = 10,
|
|
b = 10 + 1,
|
|
~
|
|
!!! error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
c = b,
|
|
~
|
|
!!! error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
d = (c) + 1,
|
|
~
|
|
!!! error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
e = 10 << 2 * 8,
|
|
~
|
|
!!! error TS1066: Ambient enum elements can only have integer literal initializers.
|
|
} |