Only check overlaps if we found an array/tuple in the intersection

This commit is contained in:
Ron Buckton
2022-06-17 11:20:36 -07:00
parent f8752ad296
commit 95b896b5fe
+13 -8
View File
@@ -21201,17 +21201,22 @@ namespace ts {
}
arrayOrTupleConstituent = constituent;
}
else {
const properties = getPropertiesOfType(constituent);
for (const property of properties) {
if (isNumericLiteralName(property.escapedName) || property.escapedName === "length" as __String) {
}
if (arrayOrTupleConstituent) {
for (const constituent of (type as IntersectionType).types) {
if (constituent !== arrayOrTupleConstituent) {
const properties = getPropertiesOfType(constituent);
for (const property of properties) {
if (isNumericLiteralName(property.escapedName) || property.escapedName === "length" as __String) {
return undefined;
}
}
if (some(getIndexInfosOfType(constituent))) {
return undefined;
}
}
if (some(getIndexInfosOfType(constituent))) {
return undefined;
}
}
}