1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix #2251 - add support for yielding from lists

This commit is contained in:
Matthew Brown 2019-10-20 12:09:04 -04:00
parent 22e35a7233
commit 3bb0016434

View File

@ -245,6 +245,10 @@ class ReturnTypeCollector
$type = $type->getGenericArrayType();
}
if ($type instanceof Type\Atomic\TList) {
$type = new Type\Atomic\TArray([Type::getInt(), $type->type_param]);
}
if ($type instanceof Type\Atomic\TArray
|| $type instanceof Type\Atomic\TIterable
|| ($type instanceof Type\Atomic\TGenericObject