1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Cleanup extra issues from recent fixes

This commit is contained in:
Brown 2019-08-27 14:16:34 -04:00
parent 1cb8c3f6c4
commit 4db8ca6a1d
2 changed files with 7 additions and 1 deletions

View File

@ -777,6 +777,8 @@ class CallAnalyzer
) {
$array_arg = $args[0]->value;
$context->inside_call = true;
if (ExpressionAnalyzer::analyze(
$statements_analyzer,
$array_arg,
@ -795,7 +797,6 @@ class CallAnalyzer
}
}
$context->inside_call = true;
if (isset($array_arg->inferredType) && $array_arg->inferredType->hasArray()) {
/** @var TArray|ObjectLike */
$array_type = $array_arg->inferredType->getTypes()['array'];

View File

@ -452,6 +452,11 @@ class ArrayFetchAnalyzer
// ok, type becomes an ObjectLike
$array_type->removeType($type_string);
$type = new ObjectLike([$key_value => $from_mixed_array ? Type::getMixed() : Type::getEmpty()]);
if ($from_mixed_array) {
$type->had_mixed_value = true;
}
$array_type->addType($type);
}