fix(42133): fix instantiated undefined type from JS initializer (#42662)

This commit is contained in:
Oleksandr T
2021-02-12 03:07:14 +02:00
committed by GitHub
parent c7bac6f2e6
commit 475036950e
5 changed files with 59 additions and 2 deletions

View File

@@ -19489,8 +19489,8 @@ namespace ts {
}
function isEmptyArrayLiteralType(type: Type): boolean {
const elementType = isArrayType(type) ? getTypeArguments(type)[0] : undefined;
return elementType === undefinedWideningType || elementType === implicitNeverType;
const elementType = getElementTypeOfArrayType(type);
return strictNullChecks ? elementType === implicitNeverType : elementType === undefinedWideningType;
}
function isTupleLikeType(type: Type): boolean {