mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Only check overlaps if we found an array/tuple in the intersection
This commit is contained in:
+13
-8
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user