From 6fa5da95ac267ec0bb8cfea6da2d5cde72c6fdb4 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 4 Dec 2022 19:37:45 +0100 Subject: [PATCH] Possibly fix --- src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php | 3 +++ src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php b/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php index b3c85187f..0e0210a16 100644 --- a/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php +++ b/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php @@ -87,6 +87,9 @@ class ArrayTypeComparator || $input_type_part instanceof TArray ) ) { + if ($atomic_comparison_result) { + $atomic_comparison_result->type_coerced = true; + } return false; } diff --git a/src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php b/src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php index 0fe9df1d1..6346e31d1 100644 --- a/src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php +++ b/src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php @@ -43,6 +43,9 @@ class KeyedArrayComparator && $input_type_part instanceof TKeyedArray && !$input_type_part->is_list ) { + if ($atomic_comparison_result) { + $atomic_comparison_result->type_coerced = true; + } return false; }