Skip to content

fix: keep generator send values through ternary echoes#324

Merged
nahime0 merged 1 commit into
mainfrom
codex/fix-generator-send-value
Jun 1, 2026
Merged

fix: keep generator send values through ternary echoes#324
nahime0 merged 1 commit into
mainfrom
codex/fix-generator-send-value

Conversation

@nahime0
Copy link
Copy Markdown
Member

@nahime0 nahime0 commented Jun 1, 2026

Summary

  • keep generator yield-assignment values live through ternary echo statements
  • add Mixed-slot null checks to the narrow generator IR
  • add a regression test for Generator::send() followed by a ternary echo before termination

Validation

  • cargo test test_generator_send_value_reaches_ternary_echo_before_termination -- --nocapture
  • cargo test codegen::generators::send_throw
  • cargo test codegen::generators
  • manual PHP/elephc comparison for the issue reproduction: both print 15
  • git diff --check

Closes #308

@nahime0 nahime0 merged commit 66509fb into main Jun 1, 2026
2 checks passed
@nahime0 nahime0 deleted the codex/fix-generator-send-value branch June 1, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Generator::send() drops the yielded-in value

1 participant