Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 20, 2022
1 parent 1263d9c commit 7d40377
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Type/IntersectionType.php
Expand Up @@ -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
Expand Down

0 comments on commit 7d40377

Please sign in to comment.