mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
better fix for reconciling iterable and object (#4712)
This commit is contained in:
parent
0b605d6b3c
commit
45d058c2dd
@ -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 {
|
||||
|
@ -130,7 +130,7 @@ class ReconcilerTest extends \Psalm\Tests\TestCase
|
||||
'traversableToIntersection' => ['Countable&Traversable', 'Traversable', 'Countable'],
|
||||
'iterableWithoutParamsToTraversableWithoutParams' => ['Traversable', '!array', 'iterable'],
|
||||
'iterableWithParamsToTraversableWithParams' => ['Traversable<int, string>', '!array', 'iterable<int, string>'],
|
||||
'iterableAndObject' => ['ArrayAccess<int, string>', 'object', 'iterable<int, string>'],
|
||||
'iterableAndObject' => ['Traversable<int, string>', 'object', 'iterable<int, string>'],
|
||||
'iterableAndNotObject' => ['array<int, string>', '!object', 'iterable<int, string>'],
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user