From 6af3b502df98d1899da31af45314e62849061643 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Wed, 16 Feb 2022 13:04:23 -0500 Subject: [PATCH] Remove unnecessary array assignment --- .../Statements/Expression/Fetch/ArrayFetchAnalyzer.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php index eff6da8d9e7..7c0b4672aaf 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php @@ -1163,7 +1163,6 @@ private static function handleArrayAccessOnArray( $offset_type, $in_assignment, $expected_offset_types, - $replacement_type, $array_access_type, $original_type, $has_valid_offset @@ -1231,7 +1230,6 @@ private static function handleArrayAccessOnTArray( Union $offset_type, bool $in_assignment, array &$expected_offset_types, - ?Union $replacement_type, ?Union &$array_access_type, Atomic $original_type, bool &$has_valid_offset @@ -1351,14 +1349,6 @@ private static function handleArrayAccessOnTArray( $type->count++; } - if ($in_assignment && $replacement_type) { - $type->type_params[1] = Type::combineUnionTypes( - $type->type_params[1], - $replacement_type, - $codebase - ); - } - $array_access_type = Type::combineUnionTypes( $array_access_type, $type->type_params[1]