diff --git a/src/services/suggestionDiagnostics.ts b/src/services/suggestionDiagnostics.ts index 9bcbdd65032..77abed76265 100644 --- a/src/services/suggestionDiagnostics.ts +++ b/src/services/suggestionDiagnostics.ts @@ -132,7 +132,7 @@ namespace ts { // check that a property access expression exists in there and that it is a handler const returnStatements = getReturnStatementsWithPromiseHandlers(node); if (returnStatements.length > 0) { - diags.push(createDiagnosticForNode(isVariableDeclaration(node.parent) ? node.parent.name : node, Diagnostics.This_may_be_converted_to_an_async_function)); + diags.push(createDiagnosticForNode(isVariableDeclaration(node.parent) && !node.name ? node.parent.name : node, Diagnostics.This_may_be_converted_to_an_async_function)); } }