Skip to content

Commit cf2107d

Browse files
committed
IterableType - fix getReferencedTemplateTypes again
1 parent 07e32cd commit cf2107d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/Type/IterableType.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,11 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap
358358

359359
public function getReferencedTemplateTypes(TemplateTypeVariance $positionVariance): array
360360
{
361+
$variance = $positionVariance->compose(TemplateTypeVariance::createCovariant());
362+
361363
return array_merge(
362-
$this->getIterableKeyType()->getReferencedTemplateTypes($positionVariance),
363-
$this->getIterableValueType()->getReferencedTemplateTypes($positionVariance),
364+
$this->getIterableKeyType()->getReferencedTemplateTypes($variance),
365+
$this->getIterableValueType()->getReferencedTemplateTypes($variance),
364366
);
365367
}
366368

0 commit comments

Comments
 (0)