1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix #3418 - don’t override with send type when @psalm-yield is given

This commit is contained in:
Brown 2020-06-02 13:27:17 -04:00
parent 4d149de764
commit 7caaa64825

View File

@ -186,7 +186,7 @@ class YieldAnalyzer
$storage = $source->getFunctionLikeStorage($statements_analyzer);
if ($storage->return_type) {
if ($storage->return_type && !$yield_type) {
foreach ($storage->return_type->getAtomicTypes() as $atomic_return_type) {
if ($atomic_return_type instanceof Type\Atomic\TNamedObject
&& $atomic_return_type->value === 'Generator'