@@ -13287,7 +13287,7 @@ namespace ts {
13287
13287
function isUncalledFunctionReference(node: Node, symbol: Symbol) {
13288
13288
return !(symbol.flags & (SymbolFlags.Function | SymbolFlags.Method))
13289
13289
|| !isCallLikeExpression(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) {
@@ -25038,7 +25038,7 @@ namespace ts {
25038
25038
propType = indexInfo.type;
25039
25039
}
25040
25040
else {
25041
- if (prop.valueDeclaration?.flags & NodeFlags.Deprecated && isUncalledFunctionReference(node, prop)) {
25041
+ if (prop.valueDeclaration && getCombinedNodeFlags(prop.valueDeclaration) & NodeFlags.Deprecated && isUncalledFunctionReference(node, prop)) {
25042
25042
errorOrSuggestion(/* isError */ false, right, Diagnostics._0_is_deprecated, right.escapedText as string);
25043
25043
}
25044
25044
@@ -27492,7 +27492,7 @@ namespace ts {
27492
27492
}
27493
27493
27494
27494
function checkDeprecatedSignature(signature: Signature, node: Node) {
27495
- if (signature.declaration && signature.declaration.flags & NodeFlags.Deprecated) {
27495
+ if (signature.declaration && getCombinedNodeFlags( signature.declaration) & NodeFlags.Deprecated) {
27496
27496
errorOrSuggestion(/*isError*/ false, node, Diagnostics._0_is_deprecated, signatureToString(signature));
27497
27497
}
27498
27498
}
@@ -30883,7 +30883,7 @@ namespace ts {
30883
30883
}
30884
30884
const symbol = getNodeLinks(node).resolvedSymbol;
30885
30885
if (symbol) {
30886
- if (every(symbol.declarations, d => !isTypeDeclaration(d) || !!(d.flags & NodeFlags.Deprecated))) {
30886
+ if (every(symbol.declarations, d => !isTypeDeclaration(d) || !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated))) {
30887
30887
const diagLocation = isTypeReferenceNode(node) && isQualifiedName(node.typeName) ? node.typeName.right : node;
30888
30888
errorOrSuggestion(/* isError */ false, diagLocation, Diagnostics._0_is_deprecated, symbol.escapedName as string);
30889
30889
}
@@ -35230,8 +35230,8 @@ namespace ts {
35230
35230
}
35231
35231
35232
35232
if (isImportSpecifier(node) &&
35233
- (target.valueDeclaration && target.valueDeclaration.flags & NodeFlags.Deprecated
35234
- || every(target.declarations, d => !!(d.flags & NodeFlags.Deprecated)))) {
35233
+ (target.valueDeclaration && getCombinedNodeFlags( target.valueDeclaration) & NodeFlags.Deprecated
35234
+ || every(target.declarations, d => !!(getCombinedNodeFlags(d) & NodeFlags.Deprecated)))) {
35235
35235
errorOrSuggestion(/* isError */ false, node.name, Diagnostics._0_is_deprecated, symbol.escapedName as string);
35236
35236
}
35237
35237
}
0 commit comments