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); });