Skip to content
Permalink
Browse files

Fix negations of templated numeric

  • Loading branch information
muglug committed Dec 10, 2019
1 parent a3ab8e8 commit 423288d2feda4d1a80edf55b4b065293dfd3f8f0
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/Psalm/Internal/Type/NegatedAssertionReconciler.php
@@ -869,14 +869,16 @@ private static function reconcileNumeric(
|| $existing_var_type->hasScalar();

foreach ($existing_var_type->getTypes() as $type) {
if (!$type->isNumericType()) {
$non_numeric_types[] = $type;
} elseif ($type instanceof TTemplateParam) {
if ($type instanceof TTemplateParam) {
if (!$type->as->hasNumeric()) {
if ($type->as->hasMixed()) {
$did_remove_type = true;
}

$non_numeric_types[] = $type;
}

$did_remove_type = true;
} elseif (!$type->isNumericType()) {
$non_numeric_types[] = $type;
} else {
$did_remove_type = true;
}

0 comments on commit 423288d

Please sign in to comment.
You can’t perform that action at this time.