Compile the generator guard as an unreachable yield instead of a yield from

This commit is contained in:
Fabien Potencier
2026-09-22 21:30:14 +01:00
parent c33dd1c473
commit 4d5d233776
9 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -379,7 +379,7 @@ final class ModuleNode extends Node implements CoercesChildrenToStringInterface
$compiler->subcompile($this->getNode('display_end'));
if (!$this->hasNode('parent')) {
$compiler->write("yield from [];\n");
$compiler->write("return; yield;\n");
}
$compiler