mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fixes
This commit is contained in:
parent
0a743971f6
commit
627e9821e5
@ -210,7 +210,7 @@ class Reconciler
|
|||||||
|
|
||||||
$has_object_array_access = false;
|
$has_object_array_access = false;
|
||||||
|
|
||||||
$result_type = $existing_types[$key] ?? self::getValueForKey(
|
$result_type = $existing_types[$key] ?? (self::getValueForKey(
|
||||||
$codebase,
|
$codebase,
|
||||||
$key,
|
$key,
|
||||||
$existing_types,
|
$existing_types,
|
||||||
@ -221,9 +221,9 @@ class Reconciler
|
|||||||
$has_empty,
|
$has_empty,
|
||||||
$inside_loop,
|
$inside_loop,
|
||||||
$has_object_array_access
|
$has_object_array_access
|
||||||
);
|
) ?? Type::getNever());
|
||||||
|
|
||||||
if ($result_type && $result_type->isUnionEmpty()) {
|
if ($result_type->isUnionEmpty()) {
|
||||||
throw new InvalidArgumentException('Union::$types cannot be empty after get value for ' . $key);
|
throw new InvalidArgumentException('Union::$types cannot be empty after get value for ' . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ class Reconciler
|
|||||||
|| ($result_type->hasString() && !$result_type->hasLiteralString())))
|
|| ($result_type->hasString() && !$result_type->hasLiteralString())))
|
||||||
|| $statements_analyzer->data_flow_graph instanceof VariableUseGraph
|
|| $statements_analyzer->data_flow_graph instanceof VariableUseGraph
|
||||||
) {
|
) {
|
||||||
if ($before_adjustment && $before_adjustment->parent_nodes) {
|
if ($before_adjustment->parent_nodes) {
|
||||||
$result_type = $result_type->setParentNodes($before_adjustment->parent_nodes);
|
$result_type = $result_type->setParentNodes($before_adjustment->parent_nodes);
|
||||||
} elseif (!$did_type_exist && $code_location) {
|
} elseif (!$did_type_exist && $code_location) {
|
||||||
$result_type = $result_type->setParentNodes(
|
$result_type = $result_type->setParentNodes(
|
||||||
@ -318,12 +318,11 @@ class Reconciler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($before_adjustment && $before_adjustment->by_ref) {
|
if ($before_adjustment->by_ref) {
|
||||||
$result_type = $result_type->setByRef(true);
|
$result_type = $result_type->setByRef(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$type_changed = !$before_adjustment
|
$type_changed = !$result_type->equals($before_adjustment)
|
||||||
|| !$result_type->equals($before_adjustment)
|
|
||||||
|| $result_type->different
|
|| $result_type->different
|
||||||
|| $before_adjustment->different;
|
|| $before_adjustment->different;
|
||||||
|
|
||||||
@ -771,7 +770,9 @@ class Reconciler
|
|||||||
$key_parts_key = str_replace('\'', '', $array_key);
|
$key_parts_key = str_replace('\'', '', $array_key);
|
||||||
|
|
||||||
if (!isset($array_properties[$key_parts_key])) {
|
if (!isset($array_properties[$key_parts_key])) {
|
||||||
if ($existing_key_type_part->fallback_params !== null) {
|
if ($existing_key_type_part->fallback_params !== null
|
||||||
|
&& !(!is_numeric($key_parts_key) && $existing_key_type_part->is_list)
|
||||||
|
) {
|
||||||
$new_base_type_candidate = $existing_key_type_part
|
$new_base_type_candidate = $existing_key_type_part
|
||||||
->fallback_params[1]->setDifferent(true);
|
->fallback_params[1]->setDifferent(true);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user