From 8a2983e5e983fd8cff893205a28a1b649ef98b50 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Thu, 15 Oct 2020 09:57:37 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20#4336=20-=20don=E2=80=99t=20merge=20sourc?= =?UTF-8?q?es=20twice=20for=20null=20coalesce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Analyzer/Statements/Expression/AssignmentAnalyzer.php | 8 -------- tests/UnusedVariableTest.php | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) 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' => [ + '