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
Sema: importing std.fs into a compiler module makes ComptimeEval's unsafe { strerror(code) } an "unsafe block contains no unsafe operations" error #1695
Found while adding src/Uat.w (#1659). With use std.fs in the new module, with check src/main.w reports:
error: unsafe block contains no unsafe operations
--> src/ComptimeEval.w:538:16
538 | let text = unsafe { strerror(code) }
(and the same at src/compiler/LlvmBridge.w:469). Both lib/std/fs.w:10 and src/ComptimeEval.w:24 declare extern fn strerror(errnum: i32) -> *mut i8 — identical signatures — yet a second module importing the stdlib declaration changes how ComptimeEval's own call is classified (raw → safe), so an unsafe block that was required becomes an error. Extern declarations appear to be unified by name across modules with the first-seen classification winning, or std.fs's import path marks the symbol as covered by a facade. Removing use std.fs (using the with_fs_* seams directly) restores the check. Repro: add use std.fs to any compiler module and with check src/main.w.
Activity
Build graph, seed, Sema and c_import fixes: stale-input records, seed…
ehartford commentedon Sep 26, 2026
Fixed on main by #1705 (db89bc5): an extern call is classified by the calling module's own declaration; pinned in both import orders.