1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

wrap row in union again

From: https://github.com/vimeo/psalm/pull/7760#discussion_r820264671

$result_element_type should be a Union, $row_shape is an Atomic
(a part of a Union). new Union([$row_shape]); should be ok
This commit is contained in:
Mateusz Cholewka 2022-03-06 21:28:48 +01:00
parent 56e65fd5ba
commit d53f57b5f7

View File

@ -115,7 +115,7 @@ class ArrayColumnReturnTypeProvider implements FunctionReturnTypeProviderInterfa
//array_column skips undefined elements so resulting type is necessarily defined //array_column skips undefined elements so resulting type is necessarily defined
$result_element_type->possibly_undefined = false; $result_element_type->possibly_undefined = false;
} elseif ($value_column_name === null) { } elseif ($value_column_name === null) {
$result_element_type = $row_shape; $result_element_type = new Union([$row_shape]);
} else { } else {
$result_element_type = Type::getMixed(); $result_element_type = Type::getMixed();
} }