Skip to content

Commit a53d4ed

Browse files
committed
Update NodeScopeResolver.php
1 parent 673580a commit a53d4ed

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6179,11 +6179,6 @@ private function produceArrayDimFetchAssignValueToWrite(array $dimFetchStack, ar
61796179
$offsetValueType = TypeCombinator::intersect($offsetValueType, TypeCombinator::union(...$types));
61806180
}
61816181

6182-
$reverseDimFetch = $dimFetchStack[count($dimFetchStack) - 1 - $i] ?? null;
6183-
if ($reverseDimFetch !== null && $reverseDimFetch->dim !== null) {
6184-
$additionalExpressions[] = [$reverseDimFetch, $valueToWrite];
6185-
}
6186-
61876182
$arrayDimFetch = $dimFetchStack[$i] ?? null;
61886183
if (
61896184
$offsetType !== null
@@ -6239,6 +6234,13 @@ private function produceArrayDimFetchAssignValueToWrite(array $dimFetchStack, ar
62396234
}
62406235
}
62416236

6237+
$iterableValueType = $valueToWrite->getIterableValueType();
6238+
foreach($dimFetchStack as $dimFetch) {
6239+
$additionalExpressions[] = [$dimFetch, $iterableValueType];
6240+
6241+
$iterableValueType = $iterableValueType->getIterableValueType();
6242+
}
6243+
62426244
return $valueToWrite;
62436245
}
62446246

0 commit comments

Comments
 (0)