Closed
Description
Loud, not silent: error: LLVM function verification failed after MIR cleanup for both.
error AgeError = Invalid(age: i32)
fn both(check: fn(i32) -> Result[Unit, AgeError]) -> bool: check(1).is_ok() and check(-1).is_err()
fn strict(age: i32) -> Result[Unit, AgeError]:
if age < 0: return Err(.Invalid(age))
Ok(())
fn main:
print(f"{both(strict)}")
Reproduced on main (installed compiler, 2fd2c59 and later). Not yet root-caused: the next step is the IR of both (with ir), to see which instruction the verifier rejects for the indirect call returning Result[Unit, E].
Blocks: the closure half of the §4.9 fix (a Result[Unit, E] closure body that falls through after an early return Err(...)) cannot be tested until a fn(...) -> Result[Unit, E] value can be called. The function half is fixed and tested in behav_result_unit_falls_through_after_early_err.w; the closure site in SemaCheck.w (~14274) still says "missing return" and should get the same type_is_result_of_unit exemption once this is fixed.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Five defects the c-interop example exposed: str lending in raw calls,…
Five defects the c-interop example exposed: str lending in raw calls,…
Five defects the c-interop example exposed, rebased onto main; CStr.t…
Fix #1229 (array literal to []T segfault) and #1230 (call through a l…
MirLower: a call through a let-alias of a non-Copy fn field calls the…
MirLower: a call through a let-alias of a non-Copy fn field calls the…
ehartford commentedon Sep 26, 2026
Verified fixed on main 55739d4 (release binary): indirect call returning Result[Unit, E] runs, prints true.
Sema owns cast acceptance and the wildcard let; MirLower reads Sema's…
Sema owns cast acceptance and the wildcard let; MirLower reads Sema's…
Sema owns cast acceptance and the wildcard let; MirLower reads Sema's…
Sema owns cast acceptance and the wildcard let; MirLower reads Sema's…
Sema owns cast acceptance and the wildcard let; MirLower reads Sema's…
Sema owns cast acceptance and the wildcard let; MirLower reads Sema's…
#2043: name-callee calls lower by Sema's resolved kind; sym_is_generi…