mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #2987 - ignore MixedReturnTypeCoercion for generator send param
This commit is contained in:
parent
9e29f6107a
commit
f7907eb43f
@ -2142,6 +2142,13 @@ class TypeAnalyzer
|
||||
$param_comparison_result,
|
||||
$allow_interface_equality
|
||||
)) {
|
||||
if ($input_type_part->value === 'Generator'
|
||||
&& $i === 2
|
||||
&& $param_comparison_result->type_coerced_from_mixed
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$atomic_comparison_result->type_coerced
|
||||
= $param_comparison_result->type_coerced === true
|
||||
&& $atomic_comparison_result->type_coerced !== false;
|
||||
|
@ -643,8 +643,7 @@ class ClassTemplateCovarianceTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Generator<int,Bar,Bar,mixed>
|
||||
* @psalm-suppress MixedReturnTypeCoercion
|
||||
* @return Generator<int, Bar, Bar, mixed>
|
||||
*/
|
||||
function gen() : Generator {
|
||||
$bar = yield new Bar();
|
||||
|
Loading…
x
Reference in New Issue
Block a user