diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php index 9bee2906c..63f82de93 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php @@ -1273,14 +1273,6 @@ class AssignmentAnalyzer $statements_analyzer->node_data->setType($stmt, $fake_coalesce_type); } - BinaryOpAnalyzer::addDataFlow( - $statements_analyzer, - $stmt, - $stmt->var, - $stmt->expr, - 'coalesce' - ); - return true; } diff --git a/tests/UnusedVariableTest.php b/tests/UnusedVariableTest.php index 7a2bb6c4a..22f63f9fa 100644 --- a/tests/UnusedVariableTest.php +++ b/tests/UnusedVariableTest.php @@ -2188,6 +2188,14 @@ class UnusedVariableTest extends TestCase print_r(...func_get_args()); }' ], + 'nullCoalesce' => [ + '