Issue #2978: Lowering: a caught block whose tail starts with a throwing call fails with NK1343 “leading +”

Open and answer this issue on GitHub.

ready, bugs, queued · opened 2026-11-30 · updated 2026-11-30 · 0 comments

Filed by the driver from the Found: of the run of issue-2952 (#2952) (owner, 2026-11-06).

Found

fn main() throws { let x = { boom(3) + 1 } catch { error.code }; println(f"{x}") } with struct Refused { code: i64 }, impl Error for Refused { fn message(ref self) -> String { return f"refused {self.code}" } } and fn boom(n: i64) -> i64 throws { if n > 0 { throw Refused { code: n } }; return n } gives NK1343 “leading + is not supported” plus “mismatched types” today and should print 3 (Part I 7.1). The lowered block is { match boom(3) { Ok(value) => value, Err(error) => break '__nikaia_caught_12 Err(error.into()) } + 1 }: rustc reads a tail that starts with match as a statement. Suspected: the block-tail emission does not wrap a tail whose first operand carries the failing call’s match lead (settle by lowering the probe with nikaia lower)

To build

Done when

The probe or check gives the expected output the first item names from its ADR or Part I-III section, and a tests/compiler/tests/ test (or the named check) that failed on the unfixed tree is green; or the probe already passes on develop and a test pins it, naming the commit that fixed it; or the issue is closed as by design, naming the function or ADR.


Generated by Claude Code

Back to Open Issues