Skip to content

Commit 412cc4e

Browse files
committed
Fix
1 parent 1100eab commit 412cc4e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Analyser/MutatingScope.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
15851585
continue;
15861586
}
15871587

1588-
$returnTypes[] = $returnScope->getType($returnNode->expr);
1588+
$returnTypes[] = $returnScope->toMutatingScope()->getType($returnNode->expr);
15891589
}
15901590

15911591
if (count($returnTypes) === 0) {
@@ -1612,21 +1612,21 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
16121612
if ($yieldNode->key === null) {
16131613
$keyTypes[] = new IntegerType();
16141614
} else {
1615-
$keyTypes[] = $yieldScope->getType($yieldNode->key);
1615+
$keyTypes[] = $yieldScope->toMutatingScope()->getType($yieldNode->key);
16161616
}
16171617

16181618
if ($yieldNode->value === null) {
16191619
$valueTypes[] = new NullType();
16201620
} else {
1621-
$valueTypes[] = $yieldScope->getType($yieldNode->value);
1621+
$valueTypes[] = $yieldScope->toMutatingScope()->getType($yieldNode->value);
16221622
}
16231623

16241624
continue;
16251625
}
16261626

1627-
$yieldFromType = $yieldScope->getType($yieldNode->expr);
1628-
$keyTypes[] = $yieldScope->getIterableKeyType($yieldFromType);
1629-
$valueTypes[] = $yieldScope->getIterableValueType($yieldFromType);
1627+
$yieldFromType = $yieldScope->toMutatingScope()->getType($yieldNode->expr);
1628+
$keyTypes[] = $yieldScope->toMutatingScope()->getIterableKeyType($yieldFromType);
1629+
$valueTypes[] = $yieldScope->toMutatingScope()->getIterableValueType($yieldFromType);
16301630
}
16311631

16321632
$returnType = new GenericObjectType(Generator::class, [

0 commit comments

Comments
 (0)