Repository navigation
Conversation
…n mismatch names both types A generic body checked on demand from inside a statement (`Enumerated.next`, demanded by a `for` over `edits.enumerate()`) inherited the caller's `match_in_stmt_pos` and `stmt_pos_depth`, so its tail `match` was checked as a statement: its arms got no demand, and the `None` arm resolved to the last enum that declared a `None` variant (the compiler's own `CliOneLinerMode`, #3088) and the body was refused with "return type mismatch" inside the standard library. check_fn_body_with_sig_once now resets both for the body and restores them after, as it already does for the caller's expectation. The two return-mismatch leaves say what they compared: "the function returns `Option[(i64, &CeremonyEdit)]`, this value is `CliOneLinerMode`" is what found this; the bare message did not. The rewriter's three index loops stay as written until a seed carries this fix: the pinned seed compiles src/ and refuses the `enumerate()` form.
ehartford
marked this pull request as ready for review
November 8, 2026 18:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3077.
A generic body checked on demand from inside a statement (
Enumerated.next, demanded by aforoveredits.enumerate()) inherited the caller'smatch_in_stmt_posandstmt_pos_depth, so its tailmatchwas checked as a statement: its arms got no demand and theNonearm resolved to the last enum that declared aNonevariant (the compiler's ownCliOneLinerMode, #3088), and the body was refused with "return type mismatch" inside the standard library.check_fn_body_with_sig_oncenow resets both for the body and restores them, as it already did for the caller's expectation.The two return-mismatch leaves now say what they compared: "the function returns
Option[(i64, &CeremonyEdit)], this value isCliOneLinerMode" is what found this.Fixture:
test/behavior/behav_3077_enumerate_beside_none_variant.w(fails on main, passes here). The rewriter's three index loops stay as written until a seed carries this fix: the pinned seed compilessrc/and refuses theenumerate()form.Gate green on this layer; the battery runs once on the stack top (#3091).