Skip to content

Commit 7443ecc

Browse files
committed
Cleaned up diagnostics
1 parent 02f6622 commit 7443ecc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9604,11 +9604,7 @@ namespace ts {
96049604
// }
96059605
//
96069606
if (location) {
9607-
if (!message) {
9608-
message = Diagnostics.Operand_for_await_does_not_have_a_valid_callable_then_member;
9609-
}
9610-
9611-
error(location, message);
9607+
error(location, Diagnostics._0_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method, symbolToString(type.symbol));
96129608
}
96139609

96149610
type = unknownType;
@@ -9640,8 +9636,7 @@ namespace ts {
96409636
let globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType();
96419637
if (globalPromiseConstructorLikeType === emptyObjectType) {
96429638
// If we couldn't resolve the global PromiseConstructorLike type we cannot verify
9643-
// compatibility with __awaiter, so we report an error.
9644-
error(node, Diagnostics.An_async_function_or_method_must_have_a_valid_awaitable_return_type);
9639+
// compatibility with __awaiter.
96459640
return unknownType;
96469641
}
96479642

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ namespace ts {
5454
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." },
5555
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." },
5656
Enum_member_must_have_initializer: { code: 1061, category: DiagnosticCategory.Error, key: "Enum member must have initializer." },
57+
_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." },
5758
An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." },
5859
Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." },
5960
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." },

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@
203203
"category": "Error",
204204
"code": 1061
205205
},
206+
"{0} is referenced directly or indirectly in the fulfillment callback of its own 'then' method.": {
207+
"category": "Error",
208+
"code": 1062
209+
},
206210
"An export assignment cannot be used in a namespace.": {
207211
"category": "Error",
208212
"code": 1063

0 commit comments

Comments
 (0)