diff --git a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php index 0022525b9..af4555c78 100644 --- a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php +++ b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php @@ -1213,7 +1213,7 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler self::refineArrayKey($clone_type->type_params[0]); - $object_types[] = new Type\Atomic\TGenericObject('ArrayAccess', $clone_type->type_params); + $object_types[] = new Type\Atomic\TGenericObject('Traversable', $clone_type->type_params); $did_remove_type = true; } else { diff --git a/tests/TypeReconciliation/ReconcilerTest.php b/tests/TypeReconciliation/ReconcilerTest.php index 157438288..6e6fafc8d 100644 --- a/tests/TypeReconciliation/ReconcilerTest.php +++ b/tests/TypeReconciliation/ReconcilerTest.php @@ -130,7 +130,7 @@ class ReconcilerTest extends \Psalm\Tests\TestCase 'traversableToIntersection' => ['Countable&Traversable', 'Traversable', 'Countable'], 'iterableWithoutParamsToTraversableWithoutParams' => ['Traversable', '!array', 'iterable'], 'iterableWithParamsToTraversableWithParams' => ['Traversable', '!array', 'iterable'], - 'iterableAndObject' => ['ArrayAccess', 'object', 'iterable'], + 'iterableAndObject' => ['Traversable', 'object', 'iterable'], 'iterableAndNotObject' => ['array', '!object', 'iterable'], ]; }