@@ -13287,7 +13287,7 @@ namespace ts {
13287
13287
function isUncalledFunctionReference(node: Node, symbol: Symbol) {
13288
13288
return !(symbol.flags & SymbolFlags.Function)
13289
13289
|| !isCallExpression(findAncestor(node, n => !isAccessExpression(n)) ?? node.parent)
13290
- && every(symbol.declarations, d => !isFunctionLike(d) || !!(d.flags & NodeFlags.Deprecated));
13290
+ && every(symbol.declarations, d => !isFunctionLike(d) || !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated));
13291
13291
}
13292
13292
13293
13293
function getPropertyTypeForIndexType(originalObjectType: Type, objectType: Type, indexType: Type, fullIndexType: Type, suppressNoImplicitAnyError: boolean, accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression | undefined, accessFlags: AccessFlags) {
@@ -13296,7 +13296,7 @@ namespace ts {
13296
13296
if (propName !== undefined) {
13297
13297
const prop = getPropertyOfType(objectType, propName);
13298
13298
if (prop) {
13299
- if (accessNode && prop.valueDeclaration?.flags & NodeFlags.Deprecated && isUncalledFunctionReference(accessNode, prop)) {
13299
+ if (accessNode && prop.valueDeclaration && getCombinedNodeFlags(prop.valueDeclaration) & NodeFlags.Deprecated && isUncalledFunctionReference(accessNode, prop)) {
13300
13300
const deprecatedNode = accessExpression?.argumentExpression ?? (isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
13301
13301
errorOrSuggestion(/* isError */ false, deprecatedNode, Diagnostics._0_is_deprecated, propName as string);
13302
13302
}
@@ -22061,7 +22061,7 @@ namespace ts {
22061
22061
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
22062
22062
let declaration: Declaration | undefined = localOrExportSymbol.valueDeclaration;
22063
22063
22064
- if (declaration?.flags & NodeFlags.Deprecated && isUncalledFunctionReference(node.parent, localOrExportSymbol)) {
22064
+ if (declaration && getCombinedNodeFlags(declaration) & NodeFlags.Deprecated && isUncalledFunctionReference(node.parent, localOrExportSymbol)) {
22065
22065
errorOrSuggestion(/* isError */ false, node, Diagnostics._0_is_deprecated, node.escapedText as string);;
22066
22066
}
22067
22067
if (localOrExportSymbol.flags & SymbolFlags.Class) {
@@ -25037,7 +25037,7 @@ namespace ts {
25037
25037
propType = indexInfo.type;
25038
25038
}
25039
25039
else {
25040
- if (prop.valueDeclaration?.flags & NodeFlags.Deprecated && isUncalledFunctionReference(node, prop)) {
25040
+ if (prop.valueDeclaration && getCombinedNodeFlags(prop.valueDeclaration) & NodeFlags.Deprecated && isUncalledFunctionReference(node, prop)) {
25041
25041
errorOrSuggestion(/* isError */ false, right, Diagnostics._0_is_deprecated, right.escapedText as string);
25042
25042
}
25043
25043
@@ -27429,7 +27429,7 @@ namespace ts {
27429
27429
return nonInferrableType;
27430
27430
}
27431
27431
27432
- if (signature.declaration && signature.declaration.flags & NodeFlags.Deprecated) {
27432
+ if (signature.declaration && getCombinedNodeFlags( signature.declaration) & NodeFlags.Deprecated) {
27433
27433
errorOrSuggestion(/*isError*/ false, node, Diagnostics._0_is_deprecated, signatureToString(signature));
27434
27434
}
27435
27435
@@ -30876,7 +30876,7 @@ namespace ts {
30876
30876
}
30877
30877
const symbol = getNodeLinks(node).resolvedSymbol;
30878
30878
if (symbol) {
30879
- if (every(symbol.declarations, d => !isTypeDeclaration(d) || !!(d.flags & NodeFlags.Deprecated))) {
30879
+ if (every(symbol.declarations, d => !isTypeDeclaration(d) || !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated))) {
30880
30880
const diagLocation = isTypeReferenceNode(node) && isQualifiedName(node.typeName) ? node.typeName.right : node;
30881
30881
errorOrSuggestion(/* isError */ false, diagLocation, Diagnostics._0_is_deprecated, symbol.escapedName as string);
30882
30882
}
@@ -35222,8 +35222,8 @@ namespace ts {
35222
35222
}
35223
35223
35224
35224
if (isImportSpecifier(node) &&
35225
- (target.valueDeclaration && target.valueDeclaration.flags & NodeFlags.Deprecated
35226
- || every(target.declarations, d => !!(d.flags & NodeFlags.Deprecated)))) {
35225
+ (target.valueDeclaration && getCombinedNodeFlags( target.valueDeclaration) & NodeFlags.Deprecated
35226
+ || every(target.declarations, d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated)))) {
35227
35227
errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string);
35228
35228
}
35229
35229
}
0 commit comments