Skip to content

Commit 914fe2a

Browse files
committed
Merge branch 2.1.x into 2.2.x
2 parents 6d37795 + c009cb0 commit 914fe2a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Analyser/ExprHandler/AssignHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -957,11 +957,11 @@ private function produceArrayDimFetchAssignValueToWrite(array $dimFetchStack, ar
957957
if ($has->yes()) {
958958
$offsetValueType = $offsetValueType->getOffsetValueType($offsetType);
959959
} elseif ($has->maybe()) {
960-
if (!$scope->hasExpressionType($dimFetch)->yes()) {
961-
$offsetValueType = TypeCombinator::union($offsetValueType->getOffsetValueType($offsetType), new ConstantArrayType([], []));
962-
} else {
960+
if ($scope->hasExpressionType($dimFetch)->yes()) {
963961
$generalizeOnWrite = false;
964962
$offsetValueType = $offsetValueType->getOffsetValueType($offsetType);
963+
} else {
964+
$offsetValueType = TypeCombinator::union($offsetValueType->getOffsetValueType($offsetType), new ConstantArrayType([], []));
965965
}
966966
} else {
967967
$generalizeOnWrite = false;

0 commit comments

Comments
 (0)