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-12-02 21:14:02 +01:00
parent 78d64e3604
commit 3ce782f0f1

View File

@ -564,15 +564,18 @@ class SimpleNegatedAssertionReconciler extends Reconciler
$properties []= $array_atomic_type->properties[$x]
?? $array_atomic_type->fallback_params[1]->setPossiblyUndefined(true);
}
assert($properties !== []);
$existing_var_type->removeType('array');
$existing_var_type->addType(new TKeyedArray(
$properties,
null,
null,
true,
$array_atomic_type->from_docblock
));
if (!$properties) {
$existing_var_type->addType(Type::getEmptyArrayAtomic());
} else {
$existing_var_type->addType(new TKeyedArray(
$properties,
null,
null,
true,
$array_atomic_type->from_docblock
));
}
}
$redundant = false;
}