Skip to content

Commit f180591

Browse files
committed
FiberScope - attempt to fix asking for types on mutated scope
1 parent 9fadf54 commit f180591

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Analyser/Fiber/FiberScope.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ public function filterByFalseyValue(Expr $expr): self
123123

124124
private function preprocessScope(MutatingScope $scope): Scope
125125
{
126+
if ($scope->getAnonymousFunctionReflection() !== $this->getAnonymousFunctionReflection()) {
127+
return $this->toMutatingScope();
128+
}
129+
130+
if ($scope->getFunction() !== $this->getFunction()) {
131+
return $this->toMutatingScope();
132+
}
133+
126134
if ($this->nativeTypesPromoted) {
127135
$scope = $scope->doNotTreatPhpDocTypesAsCertain();
128136
}

0 commit comments

Comments
 (0)