Skip to content

Commit 6f5b552

Browse files
committed
Fix
1 parent a59dad3 commit 6f5b552

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Type/TypeCombinator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ public static function intersect(Type ...$types): Type
12191219
if (
12201220
$types[$i] instanceof ConstantArrayType
12211221
&& count($types[$i]->getKeyTypes()) === 1
1222+
&& $types[$i]->isOptionalKey(0)
12221223
&& $types[$j] instanceof NonEmptyArrayType
12231224
) {
12241225
$types[$i] = $types[$i]->makeOffsetRequired($types[$i]->getKeyTypes()[0]);
@@ -1230,6 +1231,7 @@ public static function intersect(Type ...$types): Type
12301231
if (
12311232
$types[$j] instanceof ConstantArrayType
12321233
&& count($types[$j]->getKeyTypes()) === 1
1234+
&& $types[$j]->isOptionalKey(0)
12331235
&& $types[$i] instanceof NonEmptyArrayType
12341236
) {
12351237
$types[$j] = $types[$j]->makeOffsetRequired($types[$j]->getKeyTypes()[0]);

0 commit comments

Comments
 (0)