1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-03 10:07:52 +01:00
This commit is contained in:
Daniil Gentili 2022-11-29 17:41:46 +01:00
parent 42380dbe87
commit e821109343
2 changed files with 15 additions and 1 deletions

View File

@ -1413,6 +1413,20 @@ class AssignmentAnalyzer
$new_assign_type = $new_assign_type->setPossiblyUndefined(false);
}
} elseif (!$assign_var_item->key instanceof PhpParser\Node\Scalar\String_
&& $assign_value_atomic_type->is_list
&& $assign_value_atomic_type->fallback_params
) {
IssueBuffer::maybeAdd(
new PossiblyUndefinedArrayOffset(
'Possibly undefined array key',
new CodeLocation($statements_analyzer->getSource(), $var)
),
$statements_analyzer->getSuppressedIssues()
);
$new_assign_type =
$assign_value_atomic_type->fallback_params[1];
}
if ($statements_analyzer->data_flow_graph && $assign_value && $new_assign_type) {

View File

@ -554,7 +554,7 @@ class TKeyedArray extends Atomic
protected function getChildNodeKeys(): array
{
return ['properties'];
return ['properties', 'fallback_params'];
}
public function equals(Atomic $other_type, bool $ensure_source_equality): bool