Skip to content

Commit

Permalink
fix Atomic creation
Browse files Browse the repository at this point in the history
  • Loading branch information
orklah committed Jun 22, 2023
1 parent 5c23496 commit 1e35985
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Psalm/Internal/Type/AssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

use function array_intersect_key;
use function array_merge;
use function assert;
use function count;
use function get_class;
use function is_string;
Expand Down Expand Up @@ -777,11 +776,17 @@ private static function filterAtomicWithAnother(
}
unset($type_1_param);

assert($type_1_atomic->fallback_params !== null);
if ($type_1_atomic->fallback_params === null) {
$fallback_types = null;
} else {
//any fallback type is now the value of iterable
$fallback_types = [$type_1_atomic->fallback_params[0], $type_2_param];
}

$matching_atomic_type = new TKeyedArray(
$type_1_properties,
$type_1_atomic->class_strings,
[$type_1_atomic->fallback_params[0], $type_2_param], //any fallback type is now the value of iterable
$fallback_types,
$type_1_atomic->is_list,
$type_1_atomic->from_docblock,
);
Expand Down

0 comments on commit 1e35985

Please sign in to comment.