Fix checker initialization crash with esModuleInterop and global merges resolving to ImportEquals aliases (#47348)

* Add minimal failing test

* Fix checker initialization crash with esModuleInterop global merges resolving to ImportEquals aliases
This commit is contained in:
Andrew Branch
2022-01-10 16:04:12 -08:00
committed by GitHub
parent 337bbcccbe
commit 852b1c2b73
5 changed files with 231 additions and 1 deletions

View File

@@ -3676,7 +3676,7 @@ namespace ts {
if (!sigs || !sigs.length) {
sigs = getSignaturesOfStructuredType(type, SignatureKind.Construct);
}
if ((sigs && sigs.length) || getPropertyOfType(type, InternalSymbolName.Default)) {
if ((sigs && sigs.length) || getPropertyOfType(type, InternalSymbolName.Default, /*skipObjectFunctionPropertyAugment*/ true)) {
const moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol!, reference);
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
}