mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Merge pull request #9903 from ygottschalk/fix/9827-union-empty-array-and-false
Fixes #9827
This commit is contained in:
commit
eb64a471c4
@ -130,7 +130,9 @@ class TypeCombiner
|
||||
if (count($combination->value_types) === 1
|
||||
&& !count($combination->objectlike_entries)
|
||||
&& (!$combination->array_type_params
|
||||
|| $combination->array_type_params[1]->isNever()
|
||||
|| ( $overwrite_empty_array
|
||||
&& $combination->array_type_params[1]->isNever()
|
||||
)
|
||||
)
|
||||
&& !$combination->builtin_type_params
|
||||
&& !$combination->object_type_params
|
||||
|
@ -338,6 +338,28 @@ class TypeCombinationTest extends TestCase
|
||||
'ArrayObject<int, string>',
|
||||
],
|
||||
],
|
||||
'emptyArrayAndFalse' => [
|
||||
'array<never, never>|false',
|
||||
[
|
||||
'array<never, never>',
|
||||
'false',
|
||||
],
|
||||
],
|
||||
'emptyArrayAndTrue' => [
|
||||
'array<never, never>|true',
|
||||
[
|
||||
'array<never, never>',
|
||||
'true',
|
||||
],
|
||||
],
|
||||
'emptyArrayWithTrueAndFalse' => [
|
||||
'array<never, never>|bool',
|
||||
[
|
||||
'array<never, never>',
|
||||
'true',
|
||||
'false',
|
||||
],
|
||||
],
|
||||
'falseDestruction' => [
|
||||
'bool',
|
||||
[
|
||||
|
Loading…
x
Reference in New Issue
Block a user