Skip to content

Commit

Permalink
Merge pull request #9787 from robchett/remove_non-empty-list_status_w…
Browse files Browse the repository at this point in the history
…hen_combining_with_empty

Incorrectly asserting non-empty-list after combining with empty list
  • Loading branch information
orklah committed Nov 3, 2023
2 parents 65f7d7f + 6044cc7 commit b9c82d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/TypeCombiner.php
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ private static function getArrayTypeFromGenericParams(
$generic_type_params[1],
$objectlike_generic_type,
$codebase,
$overwrite_empty_array,
false,
$allow_mixed_union,
);
}
Expand Down
9 changes: 9 additions & 0 deletions tests/ArrayAssignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,15 @@ function getQueryParams(): array
return $queryParams;
}',
],
'AssignListToNonEmptyList' => [
'code' => '<?php
/** @var array<int, non-empty-list<string>> $l*/
$l = [];
$l[] = [];',
'assertions' => [
'$l===' => 'non-empty-array<int, list<string>>',
],
],
];
}

Expand Down

0 comments on commit b9c82d3

Please sign in to comment.