mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Make sure to union try-set vars
This commit is contained in:
parent
7bd1c43be1
commit
fe94ae0603
@ -411,9 +411,7 @@ class TryAnalyzer
|
||||
foreach ($catch_context->vars_in_scope as $var_id => $type) {
|
||||
if ($stmt_control_actions === [ScopeAnalyzer::ACTION_END]) {
|
||||
$context->vars_in_scope[$var_id] = $type;
|
||||
} elseif (isset($context->vars_in_scope[$var_id])
|
||||
&& !$context->vars_in_scope[$var_id]->equals($type)
|
||||
) {
|
||||
} elseif (isset($context->vars_in_scope[$var_id])) {
|
||||
$context->vars_in_scope[$var_id] = Type::combineUnionTypes(
|
||||
$context->vars_in_scope[$var_id],
|
||||
$type
|
||||
|
Loading…
x
Reference in New Issue
Block a user