24 lines
1.3 KiB
Plaintext
24 lines
1.3 KiB
Plaintext
|
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.
|
||
|
}
|