Skip to content

Commit

Permalink
Add a more homogenous solution
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Apr 6, 2022
1 parent 4cfab0c commit c8cc3f4
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,14 @@ public static function analyze(

$changed_var_ids = [];

$right_context = clone $left_context;

if ($left_type_assertions) {
$right_context = clone $context;
// while in an and, we allow scope to boil over to support
// statements of the form if ($x && $x->foo())
$right_vars_in_scope = Reconciler::reconcileKeyedTypes(
$left_type_assertions,
$active_left_assertions,
$context->vars_in_scope,
$right_context->vars_in_scope,
$context->references_in_scope,
$changed_var_ids,
$left_referenced_var_ids,
Expand All @@ -149,6 +148,8 @@ public static function analyze(
);

$right_context->vars_in_scope = $right_vars_in_scope;
} else {
$right_context = clone $left_context;
}

$partitioned_clauses = Context::removeReconciledClauses($left_clauses, $changed_var_ids);
Expand Down

0 comments on commit c8cc3f4

Please sign in to comment.