assemblyscript/src/diagnosticMessages.generated.ts

115 lines
6.2 KiB
TypeScript
Raw Normal View History

2017-09-28 13:08:25 +02:00
// code below is generated from diagnosticsMessages.json by scripts/build-diagnostics
export enum DiagnosticCode {
Conversion_from_type_0_to_1_requires_an_explicit_cast = 100,
Basic_type_0_cannot_be_nullable = 101,
Unterminated_string_literal = 1002,
Identifier_expected = 1003,
_0_expected = 1005,
A_file_cannot_have_a_reference_to_itself = 1006,
Trailing_comma_not_allowed = 1009,
Unexpected_token = 1012,
A_rest_parameter_must_be_last_in_a_parameter_list = 1014,
A_required_parameter_cannot_follow_an_optional_parameter = 1016,
Statements_are_not_allowed_in_ambient_contexts = 1036,
Initializers_are_not_allowed_in_ambient_contexts = 1039,
_0_modifier_cannot_be_used_here = 1042,
Type_parameters_cannot_appear_on_a_constructor_declaration = 1092,
Type_annotation_cannot_appear_on_a_constructor_declaration = 1093,
An_accessor_cannot_have_type_parameters = 1094,
A_set_accessor_cannot_have_a_return_type_annotation = 1095,
Type_parameter_list_cannot_be_empty = 1098,
2017-10-07 14:29:43 +02:00
A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement = 1104,
A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement = 1105,
2017-09-28 13:08:25 +02:00
A_return_statement_can_only_be_used_within_a_function_body = 1108,
Expression_expected = 1109,
Type_expected = 1110,
A_default_clause_cannot_appear_more_than_once_in_a_switch_statement = 1113,
Duplicate_label_0 = 1114,
Octal_literals_are_not_allowed_in_strict_mode = 1121,
Digit_expected = 1124,
Hexadecimal_digit_expected = 1125,
Unexpected_end_of_text = 1126,
Invalid_character = 1127,
_case_or_default_expected = 1130,
String_literal_expected = 1141,
Line_break_not_permitted_here = 1142,
Declaration_expected = 1146,
Unterminated_regular_expression_literal = 1161,
Binary_digit_expected = 1177,
Octal_digit_expected = 1178,
An_implementation_cannot_be_declared_in_ambient_contexts = 1183,
An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive = 1198,
Unterminated_Unicode_escape_sequence = 1199,
2017-10-02 12:52:15 +02:00
Decorators_are_not_valid_here = 1206,
2017-09-28 13:08:25 +02:00
_abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration = 1242,
Duplicate_identifier_0 = 2300,
Cannot_find_name_0 = 2304,
Generic_type_0_requires_1_type_argument_s = 2314,
Type_0_is_not_generic = 2315,
Type_0_is_not_assignable_to_type_1 = 2322,
2017-10-07 14:29:43 +02:00
_this_cannot_be_referenced_in_current_location = 2332,
2017-10-02 12:52:15 +02:00
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access = 2357,
2017-10-07 14:29:43 +02:00
Function_implementation_is_missing_or_not_immediately_following_the_declaration = 2391,
Duplicate_function_implementation = 2393,
Expected_0_type_arguments_but_got_1 = 2558
2017-09-28 13:08:25 +02:00
}
export function diagnosticCodeToString(code: DiagnosticCode): string {
switch (code) {
case 100: return "Conversion from type '{0}' to '{1}' requires an explicit cast.";
case 101: return "Basic type '{0}' cannot be nullable.";
case 1002: return "Unterminated string literal.";
case 1003: return "Identifier expected.";
case 1005: return "'{0}' expected.";
case 1006: return "A file cannot have a reference to itself.";
case 1009: return "Trailing comma not allowed.";
case 1012: return "Unexpected token.";
case 1014: return "A rest parameter must be last in a parameter list.";
case 1016: return "A required parameter cannot follow an optional parameter.";
case 1036: return "Statements are not allowed in ambient contexts.";
case 1039: return "Initializers are not allowed in ambient contexts.";
case 1042: return "'{0}' modifier cannot be used here.";
case 1092: return "Type parameters cannot appear on a constructor declaration.";
case 1093: return "Type annotation cannot appear on a constructor declaration.";
case 1094: return "An accessor cannot have type parameters.";
case 1095: return "A 'set' accessor cannot have a return type annotation.";
case 1098: return "Type parameter list cannot be empty.";
2017-10-07 14:29:43 +02:00
case 1104: return "A 'continue' statement can only be used within an enclosing iteration statement.";
case 1105: return "A 'break' statement can only be used within an enclosing iteration or switch statement.";
2017-09-28 13:08:25 +02:00
case 1108: return "A 'return' statement can only be used within a function body.";
case 1109: return "Expression expected.";
case 1110: return "Type expected.";
case 1113: return "A 'default' clause cannot appear more than once in a 'switch' statement.";
case 1114: return "Duplicate label '{0}'.";
case 1121: return "Octal literals are not allowed in strict mode.";
case 1124: return "Digit expected.";
case 1125: return "Hexadecimal digit expected.";
case 1126: return "Unexpected end of text.";
case 1127: return "Invalid character.";
case 1130: return "'case' or 'default' expected.";
case 1141: return "String literal expected.";
case 1142: return "Line break not permitted here.";
case 1146: return "Declaration expected.";
case 1161: return "Unterminated regular expression literal.";
case 1177: return "Binary digit expected.";
case 1178: return "Octal digit expected.";
case 1183: return "An implementation cannot be declared in ambient contexts.";
case 1198: return "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.";
case 1199: return "Unterminated Unicode escape sequence.";
2017-10-02 12:52:15 +02:00
case 1206: return "Decorators are not valid here.";
2017-09-28 13:08:25 +02:00
case 1242: return "'abstract' modifier can only appear on a class, method, or property declaration.";
case 2300: return "Duplicate identifier '{0}'.";
case 2304: return "Cannot find name '{0}'.";
case 2314: return "Generic type '{0}' requires {1} type argument(s).";
case 2315: return "Type '{0}' is not generic.";
case 2322: return "Type '{0}' is not assignable to type '{1}'.";
2017-10-07 14:29:43 +02:00
case 2332: return "'this' cannot be referenced in current location.";
2017-10-02 12:52:15 +02:00
case 2357: return "The operand of an increment or decrement operator must be a variable or a property access.";
2017-09-28 13:08:25 +02:00
case 2391: return "Function implementation is missing or not immediately following the declaration.";
2017-10-07 14:29:43 +02:00
case 2393: return "Duplicate function implementation.";
case 2558: return "Expected {0} type arguments, but got {1}.";
2017-09-28 13:08:25 +02:00
default: return "";
}
}