Skip to content

Commit

Permalink
Merge pull request #6306 from orklah/misc6
Browse files Browse the repository at this point in the history
Change > assertion back to @ and put back a perf threshold
  • Loading branch information
weirdan committed Aug 15, 2021
2 parents 4c26293 + 1e17069 commit 1a7a44a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/Psalm/Internal/Algebra.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ public static function combineOredClauses(
array $right_clauses,
int $conditional_object_id
): array {
if (count($left_clauses) > 60000 || count($right_clauses) > 60000) {
return [];
}

$clauses = [];

$all_wedges = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function scrapeAssertions(

if ($var_name) {
if ($candidate_if_types) {
$if_types[$var_name] = [['>' . \json_encode($candidate_if_types[0])]];
$if_types[$var_name] = [['@' . \json_encode($candidate_if_types[0])]];
} else {
$if_types[$var_name] = [['!falsy']];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/AssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static function reconcile(

$original_assertion = $assertion;

if ($assertion[0] === '>') {
if ($assertion[0] === '@') {
$assertion = 'falsy';
$is_negation = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Psalm/Type/Reconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ public static function reconcileKeyedTypes(
$orred_type = null;

foreach ($new_type_part_parts as $new_type_part_part) {
if ($new_type_part_part[0] === '>'
if ($new_type_part_part[0] === '@'
|| ($new_type_part_part[0] === '!'
&& $new_type_part_part[1] === '>')
&& $new_type_part_part[1] === '@')
) {
if ($new_type_part_part[0] === '!') {
$nested_negated = !$negated;
Expand Down

0 comments on commit 1a7a44a

Please sign in to comment.