You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nim: branch counts try, except and finally (a handler is not a decision) #8926
Nim branch counts exception handlers, against the branch contract. Found with a Nim oracle on nim-lang/Nim lib/ (3,953 routines matched; args 0.93 / 1.00; branch 0.98 / 0.91):
A try/except/finally procedure scores branch 3 (the try, except and finally). The branch contract's corollary 1: "A handler is not a decision. catch/rescue/except/finally/ensure/trap, the guarded-region opener (try) and the raiser (throw) ... are safety's constructs", retired from 27 other rules.
A Nim proctype (cb: proc (x: int)) scores as a closure; a standalone ## comment inside a body is credited to the following routine as its doc (both reported by the oracle on the corpus, not re-checked on a minimal file).
Reproduce (pinned scanner; counts read from function_data)
proctryProc(a: int): int=try:
result= a
exceptValueError:
result=0finally:
discard# struct_branch == 3, should be 0procboolOps(a, b: bool): bool=return a and b or a # struct_branch == 0 (#8905 decides whether boolean operators count)procrealIf(a: int): int=if a >1:
return1return0# struct_branch == 1, correct
Expected
Remove try, except and finally from the Nim branch rule (move to safety or structural_boundaries as for the other languages).
Part of #8863. Time the change; rosetta:rebless-owed if counts move; add the case above as a test.
Covered by #8939 (the family split removes try/except/finally from Nim's branch). PR #9017 was closed as superseded at the owner's direction; no new worker is needed for this item. The issue closes when #8939 merges.
Claimed by promoter-bot host melek, lease renewed 2026-11-23T10:31Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.
Fixed by #8939 (handlers out of Nim branch; and/or in short_circuit) and regression-tested in #9066. The proc-type and standalone ## comment items are oracle-reported only, not reproduced, and no burned-estate program needs them; reopen with a minimal repro if one does.
Activity
squid-protocol commentedon Nov 22, 2026
Covered by #8939 (the family split removes try/except/finally from Nim's
branch). PR #9017 was closed as superseded at the owner's direction; no new worker is needed for this item. The issue closes when #8939 merges.feat(families): split boolean operators out of branch into short_circ…
squid-protocol commentedon Nov 22, 2026
Claimed by promoter-bot host
melek, lease renewed 2026-11-23T10:31Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove theclaim:meleklabel.Nim: regression tests that a handler is not a branch; fix stale branc…
squid-protocol commentedon Nov 23, 2026
Fixed by #8939 (handlers out of Nim branch; and/or in short_circuit) and regression-tested in #9066. The proc-type and standalone ## comment items are oracle-reported only, not reproduced, and no burned-estate program needs them; reopen with a minimal repro if one does.