diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/PropertyAssignmentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/PropertyAssignmentAnalyzer.php index 5fc54baa9..9437e9bbb 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/PropertyAssignmentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/PropertyAssignmentAnalyzer.php @@ -1094,9 +1094,9 @@ class PropertyAssignmentAnalyzer Type\Union $assignment_value_type, Context $context ) { - $var_id = ExpressionAnalyzer::getVarId( + $var_id = ExpressionAnalyzer::getArrayVarId( $stmt, - $statements_analyzer->getFQCLN(), + $context->self, $statements_analyzer ); diff --git a/tests/TypeReconciliation/ConditionalTest.php b/tests/TypeReconciliation/ConditionalTest.php index c55cfe97c..9be8ada1f 100644 --- a/tests/TypeReconciliation/ConditionalTest.php +++ b/tests/TypeReconciliation/ConditionalTest.php @@ -2566,6 +2566,26 @@ class ConditionalTest extends \Psalm\Tests\TestCase */ if(!(count($colonnes) == 37 || count($colonnes) == 40)) {}', ], + 'reconcilePropertyInTrait' => [ + '