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
Make ambiant & const enums report similar errors (allow any constant 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.
Copy file name to clipboardExpand all lines: src/compiler/diagnosticInformationMap.generated.ts
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,8 @@ module ts {
45
45
A_set_accessor_cannot_have_rest_parameter: {code: 1053,category: DiagnosticCategory.Error,key: "A 'set' accessor cannot have rest parameter."},
46
46
A_get_accessor_cannot_have_parameters: {code: 1054,category: DiagnosticCategory.Error,key: "A 'get' accessor cannot have parameters."},
47
47
Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: {code: 1056,category: DiagnosticCategory.Error,key: "Accessors are only available when targeting ECMAScript 5 and higher."},
48
-
Enum_member_must_have_initializer: {code: 1061,category: DiagnosticCategory.Error,key: "Enum member must have initializer."},
49
48
An_export_assignment_cannot_be_used_in_a_namespace: {code: 1063,category: DiagnosticCategory.Error,key: "An export assignment cannot be used in a namespace."},
50
-
Ambient_enum_elements_can_only_have_integer_literal_initializers: {code: 1066,category: DiagnosticCategory.Error,key: "Ambient enum elements can only have integer literal initializers."},
49
+
Ambient_enum_initializer_must_be_a_constant_expression: {code: 1066,category: DiagnosticCategory.Error,key: "Ambient enum initializer must be a constant expression."},
51
50
Unexpected_token_A_constructor_method_accessor_or_property_was_expected: {code: 1068,category: DiagnosticCategory.Error,key: "Unexpected token. A constructor, method, accessor, or property was expected."},
52
51
A_declare_modifier_cannot_be_used_with_an_import_declaration: {code: 1079,category: DiagnosticCategory.Error,key: "A 'declare' modifier cannot be used with an import declaration."},
A_computed_property_name_of_the_form_0_must_be_of_type_symbol: {code: 2471,category: DiagnosticCategory.Error,key: "A computed property name of the form '{0}' must be of type 'symbol'."},
337
336
Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: {code: 2472,category: DiagnosticCategory.Error,key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher."},
338
337
Enum_declarations_must_all_be_const_or_non_const: {code: 2473,category: DiagnosticCategory.Error,key: "Enum declarations must all be const or non-const."},
339
-
In_const_enum_declarations_member_initializer_must_be_constant_expression: {code: 2474,category: DiagnosticCategory.Error,key: "In 'const' enum declarations member initializer must be constant expression."},
340
-
const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: {code: 2475,category: DiagnosticCategory.Error,key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."},
341
-
A_const_enum_member_can_only_be_accessed_using_a_string_literal: {code: 2476,category: DiagnosticCategory.Error,key: "A const enum member can only be accessed using a string literal."},
338
+
const_enum_initializer_must_be_a_constant_expression: {code: 2474,category: DiagnosticCategory.Error,key: "'const' enum initializer must be a constant expression."},
339
+
const_enum_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: {code: 2475,category: DiagnosticCategory.Error,key: "'const' enum can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."},
340
+
const_enum_member_can_only_be_accessed_using_a_string_literal: {code: 2476,category: DiagnosticCategory.Error,key: "'const' enum member can only be accessed using a string literal."},
342
341
const_enum_member_initializer_was_evaluated_to_a_non_finite_value: {code: 2477,category: DiagnosticCategory.Error,key: "'const' enum member initializer was evaluated to a non-finite value."},
343
342
const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: {code: 2478,category: DiagnosticCategory.Error,key: "'const' enum member initializer was evaluated to disallowed value 'NaN'."},
344
343
Property_0_does_not_exist_on_const_enum_1: {code: 2479,category: DiagnosticCategory.Error,key: "Property '{0}' does not exist on 'const' enum '{1}'."},
0 commit comments