From 63c75dc491fd220a7ae08803799144b8d57fdcf8 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Sep 2022 18:35:17 +0200 Subject: [PATCH] Fix --- .../Statements/Expression/Fetch/ArrayFetchAnalyzer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php index 27e89050bc4..95adefbd8bd 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php @@ -1148,6 +1148,10 @@ private static function handleArrayAccessOnArray( && (($in_assignment && $stmt->dim) || $original_type instanceof TTemplateParam || !$offset_type->isInt()) + && !($type instanceof TNonEmptyList + && $offset_type->isSingleIntLiteral() + && $offset_type->getSingleIntLiteral() === 0 + ) ) { $type = new TArray([Type::getInt(), $type->type_param]); }