From 4e81d0c5ab78820f56da220e17fcee3dedbe143c Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Tue, 4 Jan 2022 16:36:33 +0000 Subject: [PATCH] Remove an untested chunk of issue-triggering code that has only ever caused anguish --- .../Internal/Type/AssertionReconciler.php | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/Psalm/Internal/Type/AssertionReconciler.php b/src/Psalm/Internal/Type/AssertionReconciler.php index 466285519..a29565832 100644 --- a/src/Psalm/Internal/Type/AssertionReconciler.php +++ b/src/Psalm/Internal/Type/AssertionReconciler.php @@ -473,30 +473,6 @@ class AssertionReconciler extends Reconciler } elseif (!$new_type->hasMixed()) { $has_match = true; - if ($key - && $code_location - && $new_type->getId() === $existing_var_type->getId() - //even if two objects are the same, equality is not guaranteed - // example: (ErrorException and TypeError are both Throwable but not equal) - && !$new_type->hasNamedObjectType() - && !$is_equality - && !($original_assertion === 'loaded-class-string' && $old_var_type_string === 'class-string') - && (!($statements_analyzer->getSource()->getSource() instanceof TraitAnalyzer) - || ($key !== '$this' - && !($existing_var_type->hasLiteralClassString() && $new_type->hasLiteralClassString()))) - ) { - self::triggerIssueForImpossible( - $existing_var_type, - $old_var_type_string, - $key, - $original_assertion, - true, - $negated, - $code_location, - $suppressed_issues - ); - } - $any_scalar_type_match_found = false; if ($code_location