// test: Generator with key and value types resolves value in foreach
// feature: completion
// Adapted from phpactor generics/generator_1.test
// expect: doWork(
---
<?php
class Task {
public function doWork(): void {}
}
class Foobar {
/**
* @return Generator<string, Task>
*/
public function gen(): Generator
{
}
}
$foo = new Foobar();
foreach ($foo->gen() as $bar) {
$bar-><>
}