1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-03 18:17:55 +01:00

Merge pull request #9787 from robchett/remove_non-empty-list_status_when_combining_with_empty

Incorrectly asserting non-empty-list after combining with empty list
This commit is contained in:
orklah 2023-11-03 20:55:26 +01:00 committed by GitHub
commit b9c82d37be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -1516,7 +1516,7 @@ final class TypeCombiner
$generic_type_params[1],
$objectlike_generic_type,
$codebase,
$overwrite_empty_array,
false,
$allow_mixed_union,
);
}

View File

@ -2048,6 +2048,15 @@ class ArrayAssignmentTest extends TestCase
return $queryParams;
}',
],
'AssignListToNonEmptyList' => [
'code' => '<?php
/** @var array<int, non-empty-list<string>> $l*/
$l = [];
$l[] = [];',
'assertions' => [
'$l===' => 'non-empty-array<int, list<string>>',
],
],
];
}