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
Modeled C: a callback contract cannot mark the callback optional; sqlite3_exec with no callback ("If the callback is NULL, no callback is invoked") needs a no-op fn (ruling §44) #1618
Found by the SQLite facade (D51 stage 12, ruling §66) — a gap in the facade language, left as is.
fn sqlite3_exec / callback param 2 userdata param 3 renders exec[U](sql: &str, callback: extern "C" fn(&U, c_int, *mut *mut i8, *mut *mut i8) -> c_int, ud: &U, errmsg: *mut *mut i8). SQLite documents the callback as optional: "If the callback function of the 3rd argument to sqlite3_exec() is NULL, then no callback is ever invoked." The release UAT (build/release_uat_fixtures/sqlite3_main.w) runs DDL/DML through sqlite3_exec(db, sql, null, null, null); under the facade it must pass a no-op fn and a unit userdata — ceremony for something the C API already allows. The header does not state nullability (§43: unknown nullability is nullable), so a nullable callback would be Option[extern "C" fn(…)], None skipping the userdata slot.
Proposed: the pairing clause admits callback param 2 nullable (or reads machine-readable nullability when present), rendering Option[extern "C" fn(&U, …)]; with None the userdata is passed as null. Until then: db.exec(sql, (c, n, v, k) => 0, (), null).
Already implemented on main: a callback contract's callback may be marked nullable (nullable param N, ruling §43, spec §16.2b.8; SemaFacade.verify_facade_nullable_items), rendering Option[extern "C" fn(&U, …)]. Pinned by test/behavior/behav_sqlite_facade_exec_no_callback.w (None for callback and userdata, landed in 67f9449) and behav_sqlite_facade_end_to_end.w (Some(on_row), Some(Ctx { .. })), both green in the 2026-09-27 stack battery.
Activity
Facade: `nullable param N` on a paired callback renders `Option[exter…
Facade: `nullable param N` on a paired callback renders `Option[exter…
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Facade: `nullable param N` on a paired callback renders `Option[exter…
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Modeled C stage 12b: optional callbacks, items valid on the failed st…
Modeled C §66: UAT and examples rewritten to the facade surface; zlib…
Sema: a nullable facade callback's `Some(...)` userdata is borrowed, …
Sema: a nullable facade callback's `Some(...)` userdata is borrowed, …
Spec-ruled fixes: Some(place) borrows for Option[&T], module globals …
ehartford commentedon Sep 27, 2026
Already implemented on main: a callback contract's callback may be marked nullable (
nullable param N, ruling §43, spec §16.2b.8; SemaFacade.verify_facade_nullable_items), renderingOption[extern "C" fn(&U, …)]. Pinned by test/behavior/behav_sqlite_facade_exec_no_callback.w (Nonefor callback and userdata, landed in 67f9449) and behav_sqlite_facade_end_to_end.w (Some(on_row), Some(Ctx { .. })), both green in the 2026-09-27 stack battery.