1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 02:27:59 +01:00

Make clear that class string check for trait $this key only applies to certain assertions

This commit is contained in:
Matthew Brown 2022-01-04 17:08:34 +00:00
parent 4e81d0c5ab
commit 63f3460df7

View File

@ -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,