🤖 Pick PR #59325 (Don't skip markLinkedReferences on ...) into release-5.5 (#59336)

Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
This commit is contained in:
TypeScript Bot
2024-07-18 08:38:01 +09:00
committed by GitHub
co-authored by Jake Bailey
parent 1109550e2c
commit f35206d202
8 changed files with 208 additions and 2 deletions
+4 -2
View File
@@ -29672,8 +29672,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (!canCollectSymbolAliasAccessabilityData) {
return;
}
if (location.flags & NodeFlags.Ambient) {
return; // References within types and declaration files are never going to contribute to retaining a JS import
if (location.flags & NodeFlags.Ambient && !isPropertySignature(location) && !isPropertyDeclaration(location)) {
// References within types and declaration files are never going to contribute to retaining a JS import,
// except for properties (which can be decorated).
return;
}
switch (hint) {
case ReferenceHint.Identifier: