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:
commit
b9c82d37be
@ -1516,7 +1516,7 @@ final class TypeCombiner
|
||||
$generic_type_params[1],
|
||||
$objectlike_generic_type,
|
||||
$codebase,
|
||||
$overwrite_empty_array,
|
||||
false,
|
||||
$allow_mixed_union,
|
||||
);
|
||||
}
|
||||
|
@ -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>>',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user