Skip to content

Commit

Permalink
Negated class_exist check on class-string converts to string instead …
Browse files Browse the repository at this point in the history
…of mixed
  • Loading branch information
robchett committed Oct 8, 2023
1 parent 69d5881 commit 1d2b9c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Psalm/Internal/Type/NegatedAssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ public static function reconcile(
$existing_var_type->removeType('array');
}

if ($assertion instanceof IsNotType && $assertion_type instanceof TClassString) {
$existing_var_type->removeType(TClassString::class);
$existing_var_type->addType(new TString);
}

if (!$is_equality
&& isset($existing_var_atomic_types['int'])
&& $existing_var_type->from_calculation
Expand Down

0 comments on commit 1d2b9c6

Please sign in to comment.