Skip to content

Commit d158488

Browse files
committed
Use AccessoryArrayListType for intersection
1 parent 2223acd commit d158488

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Type/IntersectionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $uni
760760
$result = $this->intersectTypes(static fn (Type $type): Type => $type->setOffsetValueType($offsetType, $valueType, $unionValues));
761761

762762
if ($offsetType !== null && $this->isList()->yes() && $this->isIterableAtLeastOnce()->yes() && (new ConstantIntegerType(1))->isSuperTypeOf($offsetType)->yes()) {
763-
$result = TypeCombinator::intersect($result, new AccessoryArrayListType());
763+
$result = AccessoryArrayListType::intersectWith($result);
764764
}
765765

766766
return $result;

0 commit comments

Comments
 (0)