Fix incorrect deprecated mark (#39611)

* Fix incorrect deprecated mark

* improve test
This commit is contained in:
Wenlu Wang
2020-07-15 08:47:25 -07:00
committed by GitHub
parent dd2fc86f2b
commit 7b728754c0
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -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);
}
@@ -0,0 +1,14 @@
///<reference path="fourslash.ts" />
//// enum Direction {
//// Left = -1,
//// Right = 1,
//// }
//// type T = Direction.Left
//// /** @deprecated */
//// const x = 1
//// type x = string
//// var y: x = 'hi'
verify.getSuggestionDiagnostics([]);