We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f11d624 + cf2107d commit 3cbb9baCopy full SHA for 3cbb9ba
src/Type/IterableType.php
@@ -389,9 +389,11 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap
389
390
public function getReferencedTemplateTypes(TemplateTypeVariance $positionVariance): array
391
{
392
+ $variance = $positionVariance->compose(TemplateTypeVariance::createCovariant());
393
+
394
return array_merge(
- $this->getIterableKeyType()->getReferencedTemplateTypes($positionVariance),
- $this->getIterableValueType()->getReferencedTemplateTypes($positionVariance),
395
+ $this->getIterableKeyType()->getReferencedTemplateTypes($variance),
396
+ $this->getIterableValueType()->getReferencedTemplateTypes($variance),
397
);
398
}
399
0 commit comments