diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1314f1ae34d1d..c0241cb0debda 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -30908,7 +30908,7 @@ namespace ts { } const symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { - if (every(symbol.declarations, d => !isTypeDeclaration(d) || !!(d.flags & NodeFlags.Deprecated))) { + if (some(symbol.declarations, d => isTypeDeclaration(d) && !!(d.flags & NodeFlags.Deprecated))) { const diagLocation = isTypeReferenceNode(node) && isQualifiedName(node.typeName) ? node.typeName.right : node; errorOrSuggestion(/* isError */ false, diagLocation, Diagnostics._0_is_deprecated, symbol.escapedName as string); } diff --git a/tests/cases/fourslash/jsdocDeprecated_suggestion7.ts b/tests/cases/fourslash/jsdocDeprecated_suggestion7.ts new file mode 100644 index 0000000000000..ff98ed0179f39 --- /dev/null +++ b/tests/cases/fourslash/jsdocDeprecated_suggestion7.ts @@ -0,0 +1,14 @@ +/// + +//// enum Direction { +//// Left = -1, +//// Right = 1, +//// } +//// type T = Direction.Left + +//// /** @deprecated */ +//// const x = 1 +//// type x = string +//// var y: x = 'hi' + +verify.getSuggestionDiagnostics([]);