Skip to content

Commit

Permalink
Fixed object comparison that aims to improve nested template analysis (
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel GUITON committed Dec 22, 2022
1 parent b138107 commit 164e279
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Psalm/Internal/Type/Comparator/ObjectComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public static function isShallowlyContainedBy(
): bool {
if ($container_type_part instanceof TTemplateParam
&& $input_type_part instanceof TTemplateParam
&& $container_type_part->defining_class != $input_type_part->defining_class
&& strpos($container_type_part->defining_class, 'fn-') !== 0
&& strpos($input_type_part->defining_class, 'fn-') !== 0
&& 1 == count($container_type_part->as->getAtomicTypes())
&& 1 == count($input_type_part->as->getAtomicTypes())) {
$containerAs = current($container_type_part->as->getAtomicTypes());
Expand Down
3 changes: 0 additions & 3 deletions tests/Template/ClassTemplateExtendsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1635,9 +1635,6 @@ public function __construct(array $elements = [])
public function getIterator()
{
/**
* @psalm-suppress InvalidReturnStatement
*/
return new ArrayIterator($this->elements);
}
Expand Down

0 comments on commit 164e279

Please sign in to comment.