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 ed5419e commit 1c6ba90
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Psalm/Internal/Type/AssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,13 @@ private static function filterAtomicWithAnother(
}
unset($type_1_param);

$matching_atomic_type = $type_1_atomic->setProperties($type_1_properties);
$matching_atomic_type->fallback_params[1] = $type_2_param;//any fallback type is now the value of iterable
$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

Check failure on line 782 in src/Psalm/Internal/Type/AssertionReconciler.php

View workflow job for this annotation

GitHub Actions / build

ArgumentTypeCoercion

src/Psalm/Internal/Type/AssertionReconciler.php:782:17: ArgumentTypeCoercion: Argument 3 of Psalm\Type\Atomic\TKeyedArray::__construct expects list{Psalm\Type\Union, Psalm\Type\Union}|null, but parent type list{Psalm\Type\Union|null, Psalm\Type\Union} provided (see https://psalm.dev/193)

Check failure on line 782 in src/Psalm/Internal/Type/AssertionReconciler.php

View workflow job for this annotation

GitHub Actions / build

PossiblyNullArrayAccess

src/Psalm/Internal/Type/AssertionReconciler.php:782:18: PossiblyNullArrayAccess: Cannot access array value on possibly null variable $type_1_atomic->fallback_params of type list{Psalm\Type\Union, Psalm\Type\Union}|null (see https://psalm.dev/079)
$type_1_atomic->is_list,
$type_1_atomic->from_docblock,
);
$atomic_comparison_results->type_coerced = true;
}

Expand Down

0 comments on commit 1c6ba90

Please sign in to comment.