From 63f3460df74a4268c51c4cd426466b10d8b79c96 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Tue, 4 Jan 2022 17:08:34 +0000 Subject: [PATCH] Make clear that class string check for trait $this key only applies to certain assertions --- src/Psalm/Internal/Type/AssertionReconciler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Type/AssertionReconciler.php b/src/Psalm/Internal/Type/AssertionReconciler.php index a29565832..b7a1ef9a0 100644 --- a/src/Psalm/Internal/Type/AssertionReconciler.php +++ b/src/Psalm/Internal/Type/AssertionReconciler.php @@ -482,7 +482,7 @@ class AssertionReconciler extends Reconciler && !$new_type_has_interface && (!($statements_analyzer->getSource()->getSource() instanceof TraitAnalyzer) || ($key !== '$this' - && !($existing_var_type->hasLiteralClassString() && $new_type->hasLiteralClassString()))) + && strpos($original_assertion, 'isa-') !== 0)) && UnionTypeComparator::isContainedBy( $codebase, $existing_var_type,