mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix #3639 - allow coerced types to count when picking callmap options
This commit is contained in:
parent
1f86afece7
commit
9b860214d5
@ -169,13 +169,16 @@ class InternalCallMapHandler
|
||||
}
|
||||
}
|
||||
|
||||
$arg_result = new \Psalm\Internal\Analyzer\TypeComparisonResult();
|
||||
|
||||
if (TypeAnalyzer::isContainedBy(
|
||||
$codebase,
|
||||
$arg_type,
|
||||
$param_type,
|
||||
true,
|
||||
true
|
||||
)) {
|
||||
true,
|
||||
$arg_result
|
||||
) || $arg_result->type_coerced) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1174,6 +1174,21 @@ class FunctionCallTest extends TestCase
|
||||
);
|
||||
}',
|
||||
],
|
||||
'pregReplaceCallbackWithArray' => [
|
||||
'<?php
|
||||
/**
|
||||
* @param string[] $ids
|
||||
* @psalm-suppress MissingClosureReturnType
|
||||
* @psalm-suppress MixedArgumentTypeCoercion
|
||||
*/
|
||||
function(array $ids): array {
|
||||
return \preg_replace_callback(
|
||||
"",
|
||||
fn (array $matches) => $matches[4],
|
||||
$ids
|
||||
);
|
||||
};'
|
||||
],
|
||||
'compactDefinedVariable' => [
|
||||
'<?php
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user