Skip to content

Commit 2587cc7

Browse files
committed
Update TypeSpecifier.php
1 parent 877cbf6 commit 2587cc7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Analyser/TypeSpecifier.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ public function specifyTypesInCondition(
455455
!$context->null()
456456
&& $expr->right instanceof Expr\CallLike
457457
) {
458+
if (!$scope instanceof MutatingScope) {
459+
throw new ShouldNotHappenException();
460+
}
458461
$newScope = $scope->filterBySpecifiedTypes($result);
459462
$callType = $newScope->getType($expr->right);
460463
$newContext = TypeSpecifierContext::createTruthy($callType);

0 commit comments

Comments
 (0)