Skip to content

Commit 6fe4be2

Browse files
committed
Exclude arrays and tuples from full intersection property check
1 parent 2524fb1 commit 6fe4be2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15874,7 +15874,7 @@ namespace ts {
1587415874
// recursive intersections that are structurally similar but not exactly identical. See #37854.
1587515875
if (result && !inPropertyCheck && (
1587615876
target.flags & TypeFlags.Intersection && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
15877-
isNonGenericObjectType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && !some((<IntersectionType>source).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) {
15877+
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && !some((<IntersectionType>source).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) {
1587815878
inPropertyCheck = true;
1587915879
result &= recursiveTypeRelatedTo(source, target, reportErrors, IntersectionState.PropertyCheck);
1588015880
inPropertyCheck = false;

0 commit comments

Comments
 (0)