mirror of
https://github.com/danog/psalm.git
synced 2024-12-03 18:17:55 +01:00
Fix while loop unset issue
This commit is contained in:
parent
91ea6844ba
commit
ff17dcf1ee
@ -2030,12 +2030,14 @@ class StatementsChecker
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($while_context->vars_in_scope[$var]->isMixed()) {
|
||||
$context->vars_in_scope[$var] = $while_context->vars_in_scope[$var];
|
||||
}
|
||||
if (isset($while_context->vars_in_scope[$var])) {
|
||||
if ($while_context->vars_in_scope[$var]->isMixed()) {
|
||||
$context->vars_in_scope[$var] = $while_context->vars_in_scope[$var];
|
||||
}
|
||||
|
||||
if ((string) $while_context->vars_in_scope[$var] !== (string) $type) {
|
||||
$context->vars_in_scope[$var] = Type::combineUnionTypes($while_context->vars_in_scope[$var], $type);
|
||||
if ((string) $while_context->vars_in_scope[$var] !== (string) $type) {
|
||||
$context->vars_in_scope[$var] = Type::combineUnionTypes($while_context->vars_in_scope[$var], $type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user