File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3237,14 +3237,6 @@ public function filterBySpecifiedTypes(SpecifiedTypes $specifiedTypes): self
32373237 }
32383238
32393239 // Pass 2: Supertype match. Only runs when Pass 1 found no exact match for this expression.
3240- // Skip No-certainty holders here because supertype matching is asymmetric:
3241- // a broader condition type (the "undefined" branch) is more likely to match
3242- // as a supertype of a narrowed specified type than a narrower condition type
3243- // (the "defined" branch), causing conditionally-defined variables to be
3244- // incorrectly resolved as never defined.
3245- // Pass 1 does not need this check because exact matching cannot produce
3246- // this asymmetry - if the specified type exactly equals the No branch's
3247- // condition, the scope genuinely corresponds to the "undefined" state.
32483240 foreach ($ conditionalExpressions as $ conditionalExpression ) {
32493241 if ($ conditionalExpression ->getTypeHolder ()->getCertainty ()->no ()) {
32503242 continue ;
You can’t perform that action at this time.
0 commit comments