Fix bug when augmenting parent-less symbol (#28345)

This commit is contained in:
Andy
2018-11-05 12:57:33 -08:00
committed by GitHub
parent 4cb210ce2e
commit f37101e871
5 changed files with 107 additions and 1 deletions

View File

@@ -26751,7 +26751,7 @@ namespace ts {
let reportError = !(symbol.flags & SymbolFlags.Transient);
if (!reportError) {
// symbol should not originate in augmentation
reportError = isExternalModuleAugmentation(symbol.parent!.declarations[0]);
reportError = !!symbol.parent && isExternalModuleAugmentation(symbol.parent.declarations[0]);
}
}
break;