1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Only assign global vars to mixed if they don’t already exist

This commit is contained in:
Matthew Brown 2018-05-31 09:02:57 -04:00
parent 72f65cf544
commit 258e862c92

View File

@ -361,7 +361,10 @@ class FunctionCallChecker extends \Psalm\Checker\Statements\Expression\CallCheck
}
foreach ($global_variables as $var_id => $_) {
$context->vars_in_scope[$var_id] = Type::getMixed();
if (!isset($context->vars_in_scope[$var_id])) {
$context->vars_in_scope[$var_id] = Type::getMixed();
}
$context->vars_possibly_in_scope[$var_id] = true;
}