Cleaned up diagnostics
This commit is contained in:
parent
02f6622e43
commit
7443ecc6a5
3 changed files with 7 additions and 7 deletions
|
@ -9604,11 +9604,7 @@ namespace ts {
|
|||
// }
|
||||
//
|
||||
if (location) {
|
||||
if (!message) {
|
||||
message = Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member;
|
||||
}
|
||||
|
||||
error(location, message);
|
||||
error(location, Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol));
|
||||
}
|
||||
|
||||
type = unknownType;
|
||||
|
@ -9640,8 +9636,7 @@ namespace ts {
|
|||
let globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType();
|
||||
if (globalPromiseConstructorLikeType === emptyObjectType) {
|
||||
// If we couldn't resolve the global PromiseConstructorLike type we cannot verify
|
||||
// compatibility with __awaiter, so we report an error.
|
||||
error(node, Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type);
|
||||
// compatibility with __awaiter.
|
||||
return unknownType;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ namespace ts {
|
|||
Return_expression_in_async_function_does_not_have_a_valid_callable_then_member: { code: 1059, category: DiagnosticCategory.Error, key: "Return expression in async function does not have a valid callable 'then' member." },
|
||||
Expression_body_for_async_arrow_function_does_not_have_a_valid_callable_then_member: { code: 1060, category: DiagnosticCategory.Error, key: "Expression body for async arrow function does not have a valid callable 'then' member." },
|
||||
Enum_member_must_have_initializer: { code: 1061, category: DiagnosticCategory.Error, key: "Enum member must have initializer." },
|
||||
_0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: { code: 1062, category: DiagnosticCategory.Error, key: "{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method." },
|
||||
An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." },
|
||||
Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." },
|
||||
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." },
|
||||
|
|
|
@ -203,6 +203,10 @@
|
|||
"category": "Error",
|
||||
"code": 1061
|
||||
},
|
||||
"{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method.": {
|
||||
"category": "Error",
|
||||
"code": 1062
|
||||
},
|
||||
"An export assignment cannot be used in a namespace.": {
|
||||
"category": "Error",
|
||||
"code": 1063
|
||||
|
|
Loading…
Reference in a new issue