diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php index abb31467d..fa0e16e33 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php @@ -590,6 +590,11 @@ class ArrayAssignmentAnalyzer $array_atomic_type_class_string->getStandinKeyParam(), $array_atomic_type_class_string->value_param ]); + } elseif ($atomic_root_types['array'] instanceof TKeyedArray + && $atomic_root_types['array']->is_list + && $atomic_root_types['array']->fallback_params === null + ) { + $array_atomic_type = $atomic_root_types['array']; } elseif ($atomic_root_types['array'] instanceof TNonEmptyArray || ($atomic_root_types['array'] instanceof TKeyedArray && $atomic_root_types['array']->is_list diff --git a/tests/ArrayAssignmentTest.php b/tests/ArrayAssignmentTest.php index 30084237f..e835fcec9 100644 --- a/tests/ArrayAssignmentTest.php +++ b/tests/ArrayAssignmentTest.php @@ -2011,6 +2011,21 @@ class ArrayAssignmentTest extends TestCase if (\array_key_exists($currentAction, $items)) { $items[$currentAction]["active"] = true; }' + ], + 'listAppendShape' => [ + 'code' => ' [ + '$a===' => 'list{0, 1, 2}', + '$b===' => 'list{0, 1, 2}' + ] ] ]; }