Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Aug 30, 2022
1 parent be500e0 commit e5dce23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Expand Up @@ -770,8 +770,7 @@ public static function applyAssertionsToContext(
continue;
}

$assertion_rule = clone $assertion_rule;
$assertion_rule->setAtomicType($atomic_type);
$assertion_rule = $assertion_rule->setAtomicType($atomic_type);
$orred_rules[] = $assertion_rule;
}
} elseif (isset($context->vars_in_scope[$assertion_var_id])) {
Expand Down
3 changes: 1 addition & 2 deletions src/Psalm/Storage/Possibilities.php
Expand Up @@ -52,8 +52,7 @@ public function getUntemplatedCopy(
);

foreach ($union->getAtomicTypes() as $atomic_type) {
$assertion = clone $assertion;
$assertion->setAtomicType($atomic_type);
$assertion = $assertion->setAtomicType($atomic_type);
$assertion_rules[] = $assertion;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/AlgebraTest.php
Expand Up @@ -83,7 +83,7 @@ public function testNegateFormulaWithUnreconcilableTerm(): void
$a1 = new IsType(new TInt());
$formula = [
new Clause(['$a' => [(string)$a1 => $a1]], 1, 1),
new Clause(['$b' => [(string)$a1 => clone $a1]], 1, 2, false, false),
new Clause(['$b' => [(string)$a1 => $a1]], 1, 2, false, false),
];

$negated_formula = Algebra::negateFormula($formula);
Expand Down

0 comments on commit e5dce23

Please sign in to comment.