mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix incorrect deprecated mark (#39611)
* Fix incorrect deprecated mark * improve test
This commit is contained in:
@@ -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([]);
|
||||
Reference in New Issue
Block a user