diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b4f375d338c..ebea12f0410 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12511,6 +12511,9 @@ namespace ts { /** * Checks that the return type provided is an instantiation of the global Promise type * and returns the awaited type of the return type. + * + * @param returnType The return type of a FunctionLikeDeclaration + * @param location The node on which to report the error. */ function checkCorrectPromiseType(returnType: Type, location: Node) { if (returnType === unknownType) { @@ -12967,7 +12970,7 @@ namespace ts { // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent const parent = getDeclarationContainer(node); if (parent.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(parent) && parent.flags & NodeFlags.HasAsyncFunctions) { - // If the declaration happens to be in external module, report error that require and exports are reserved keywords + // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, declarationNameToString(name), declarationNameToString(name)); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f5e6254a040..27ce11f5286 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -195,7 +195,7 @@ "category": "Error", "code": 1063 }, - "The return type of an async function or method must be the global Promise.": { + "The return type of an async function or method must be the global Promise type.": { "category": "Error", "code": 1064 },