mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Merge pull request #9676 from Nicelocal/fix_callable_union_comparison
Fix comparison of unions of multiple callables
This commit is contained in:
commit
76ebf54262
@ -175,7 +175,7 @@ class UnionTypeComparator
|
||||
if ($container_required_param_count > $input_all_param_count
|
||||
|| $container_all_param_count < $input_required_param_count
|
||||
) {
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -805,7 +805,7 @@ class ArgTest extends TestCase
|
||||
function foo($a) {}
|
||||
|
||||
caller("foo");',
|
||||
'error_message' => 'InvalidScalarArgument',
|
||||
'error_message' => 'PossiblyInvalidArgument',
|
||||
],
|
||||
'callableArgsCountMismatch' => [
|
||||
'code' => '<?php
|
||||
@ -823,7 +823,7 @@ class ArgTest extends TestCase
|
||||
function foo($a, $b) {}
|
||||
|
||||
caller("foo");',
|
||||
'error_message' => 'InvalidScalarArgument',
|
||||
'error_message' => 'InvalidArgument',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
@ -159,6 +159,10 @@ class TypeComparatorTest extends TestCase
|
||||
'lowercase-string',
|
||||
'callable-string',
|
||||
],
|
||||
'callableUnionAcceptsCallableUnion' => [
|
||||
'(callable(int,string[]): void)|(callable(int): void)',
|
||||
'(callable(int): void)|(callable(int,string[]): void)',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user