Skip to content

Commit 2ae5477

Browse files
committed
Update MutatingScope.php
1 parent ec4322e commit 2ae5477

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Analyser/MutatingScope.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3226,13 +3226,8 @@ public function filterBySpecifiedTypes(SpecifiedTypes $specifiedTypes): self
32263226
if ($specifiedHolder->equals($conditionalTypeHolder)) {
32273227
continue;
32283228
}
3229+
32293230
$guardType = $conditionalTypeHolder->getType();
3230-
// Allow subtype matching: when the specified type is a strict subtype
3231-
// of the guard, fire the conditional. Restricted to UnionType and
3232-
// IntegerRangeType guards — these represent explicit sets or ranges
3233-
// of values where narrowing to a member validly satisfies the guard.
3234-
// IntersectionType, MixedType, and other types can have coincidental
3235-
// subtype relationships that cause incorrect type narrowing.
32363231
if (
32373232
$conditionalExpression->getTypeHolder()->getCertainty()->yes()
32383233
&& $specifiedHolder->getCertainty()->yes()

0 commit comments

Comments
 (0)