mirror of
https://github.com/danog/psalm.git
synced 2024-12-03 10:07:52 +01:00
If we do not know, do not assume
This commit is contained in:
parent
cb09a190ce
commit
c1ca6c27d5
@ -1911,10 +1911,7 @@ class StatementsChecker
|
||||
}
|
||||
|
||||
if ($stmt->keyVar) {
|
||||
$foreach_context->vars_in_scope[$stmt->keyVar->name] = $key_type ?: new Type\Union([
|
||||
new Type\Atomic('int'),
|
||||
new Type\Atomic('string')
|
||||
]);
|
||||
$foreach_context->vars_in_scope[$stmt->keyVar->name] = $key_type ?: Type::getMixed();
|
||||
$foreach_context->vars_possibly_in_scope[$stmt->keyVar->name] = true;
|
||||
$this->registerVariable($stmt->keyVar->name, $stmt->getLine());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user