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:
parent
72f65cf544
commit
258e862c92
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user