1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00

Fix list templates

This commit is contained in:
Daniil Gentili 2022-11-27 21:28:55 +01:00
parent 2b9512ef50
commit 0542b0e7f0
2 changed files with 9 additions and 0 deletions

View File

@ -808,6 +808,7 @@ class TemplateStandinTypeReplacer
return array_values($generic_param->getAtomicTypes());
}
$generic_param->possibly_undefined = false;
$generic_param = $generic_param->setFromDocblock()->freeze();
if (isset(

View File

@ -486,6 +486,14 @@ class TKeyedArray extends Atomic
$fallback_params = $this->fallback_params;
foreach ($fallback_params ?? [] as $offset => $property) {
$input_type_param = null;
if ($input_type instanceof TKeyedArray
&& isset($input_type->fallback_params[$offset])
) {
$input_type_param = $input_type->fallback_params[$offset];
}
$fallback_params[$offset] = TemplateStandinTypeReplacer::replace(
$property,
$template_result,