From 0efb5598d838f17fdc46e59adc39eb98a8470859 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 9 Apr 2025 13:37:54 -0700 Subject: [PATCH] Don't set parent on non-transient symbols in mergeSymbolTable --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 67a733cbbb811..dde1862745d98 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2807,7 +2807,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // When merging the module augmentation into a.ts, the symbol for `A` will itself be merged, so its parent // should be the merged module symbol. But the symbol for `B` has only one declaration, so its parent should // be the module augmentation symbol, which contains its only declaration. - merged.parent = mergedParent; + if (merged.flags & SymbolFlags.Transient) { + merged.parent = mergedParent; + } } target.set(id, merged); });