Skip to content

Commit

Permalink
Refactor a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
klimick committed May 4, 2024
1 parent 669721c commit cd8b6ff
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Psalm/Internal/Type/TemplateContextualBoundsCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,15 @@ private function collectGenericObject(TGenericObject $contextual_atomic, Atomic
if ($return_atomic instanceof TIterable
&& $contextual_atomic->value === 'Generator'
) {
$this->collectAtomic(new TIterable([
$this->collectUnion(
$contextual_atomic->type_params[0] ?? Type::getMixed(),
$return_atomic->type_params[0],
);
$this->collectUnion(
$contextual_atomic->type_params[1] ?? Type::getMixed(),
]), $return_atomic);
}

if ($return_atomic instanceof TGenericObject
$return_atomic->type_params[1],
);
} elseif ($return_atomic instanceof TGenericObject
&& $contextual_atomic->value === $return_atomic->value
) {
foreach ($return_atomic->type_params as $offset => $return_type_param) {
Expand Down

0 comments on commit cd8b6ff

Please sign in to comment.