1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Avoid false-positives while analysing memoised coalesce

This commit is contained in:
Matt Brown 2020-12-02 02:25:15 -05:00
parent 394eceb01c
commit f0876b86f4

View File

@ -35,7 +35,10 @@ class CoalesceAnalyzer
) {
$left_var_id = '$<tmp coalesce var>' . (int) $left_expr->getAttribute('startFilePos');
ExpressionAnalyzer::analyze($statements_analyzer, $left_expr, clone $context);
$cloned = clone $context;
$cloned->inside_isset = true;
ExpressionAnalyzer::analyze($statements_analyzer, $left_expr, $cloned);
$condition_type = $statements_analyzer->node_data->getType($left_expr) ?: Type::getMixed();