From 248dd35b024f53e45341501526016fc8c5bfde15 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 20 Dec 2022 15:23:22 +0100 Subject: [PATCH] Fix --- src/Type/IntersectionType.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Type/IntersectionType.php b/src/Type/IntersectionType.php index cbc9dd2cd47..71d419ea15f 100644 --- a/src/Type/IntersectionType.php +++ b/src/Type/IntersectionType.php @@ -150,7 +150,14 @@ public function isSubTypeOf(Type $otherType): TrinaryLogic public function isAcceptedBy(Type $acceptingType, bool $strictTypes): TrinaryLogic { - return TrinaryLogic::lazyMaxMin($this->getTypes(), static fn (Type $innerType) => $acceptingType->accepts($innerType, $strictTypes)); + $result = TrinaryLogic::lazyMaxMin($this->getTypes(), static fn (Type $innerType) => $acceptingType->accepts($innerType, $strictTypes)); + if ($this->isOversizedArray()->yes()) { + if (!$result->no()) { + return TrinaryLogic::createYes(); + } + } + + return $result; } public function equals(Type $type): bool