Skip to content

Fix IfStmt single-statement branch accessors - #288

Open
WindOctober (WindOctober) wants to merge 1 commit into
Qiskit:mainfrom
WindOctober:fix/if-stmt-else-branch
Open

WindOctober (WindOctober) wants to merge 1 commit into
Qiskit:mainfrom
WindOctober:fix/if-stmt-else-branch

Conversation

@WindOctober

Copy link
Copy Markdown

Fixes #287

Select if branch bodies in source order across both BlockExpr and Stmt
nodes, so else_branch_stmt() does not return the then branch.

Adds a regression test for distinct single-statement then and else branches.

Tested with:

cargo test -p oq3_syntax --test if_stmt_branches

@CLAassistant

CLAassistant commented Sep 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

IfStmt::else_branch_stmt() returns the then branch

2 participants