Skip to content

Commit

Permalink
IterableType - fix getReferencedTemplateTypes again
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 12, 2023
1 parent 07e32cd commit cf2107d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Type/IterableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,11 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap

public function getReferencedTemplateTypes(TemplateTypeVariance $positionVariance): array
{
$variance = $positionVariance->compose(TemplateTypeVariance::createCovariant());

return array_merge(
$this->getIterableKeyType()->getReferencedTemplateTypes($positionVariance),
$this->getIterableValueType()->getReferencedTemplateTypes($positionVariance),
$this->getIterableKeyType()->getReferencedTemplateTypes($variance),
$this->getIterableValueType()->getReferencedTemplateTypes($variance),
);
}

Expand Down

0 comments on commit cf2107d

Please sign in to comment.