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