Skip to content

Eager: match on last statement and use EqTest#900

Open
Cameron-Low wants to merge 1 commit intomainfrom
fix-eager
Open

Eager: match on last statement and use EqTest#900
Cameron-Low wants to merge 1 commit intomainfrom
fix-eager

Conversation

@Cameron-Low
Copy link
Contributor

This has two parts:

  1. In destruct_op, the split is done on first match: I believe the desired behaviour should be last match.
  2. When checking for equality of expressions/statements, use EcReduction.EqTest instead of base equality.

@Cameron-Low Cameron-Low requested review from loutr and strub February 13, 2026 12:11
@Cameron-Low Cameron-Low self-assigned this Feb 13, 2026
@strub
Copy link
Member

strub commented Feb 13, 2026

@Cameron-Low How eager was working with such a bug?

@Cameron-Low
Copy link
Contributor Author

I think just a lack of coverage and the simple usage. I was looking at some more recent examples that involved swapping while statements around when I ran into this; all the other examples were fine.

@loutr
Copy link
Contributor

loutr commented Feb 13, 2026

Nice catch! Indeed all examples and uses so far had no duplicate while/if statement on one side, and thus the choice for split_at_cpos1 was irrelevant.

Copy link
Member

@strub strub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for me, but add a test then. This has been unnoticed for too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants