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
D184 WIP: a comprehension over a map global in a script lowers v * 2 with v as a pointer (LLVM: "Call parameter type does not match"); audit:resolution stayed silent #2978
On branch d184-script-globals (worktree ~/.local/with-staging/stack2, commit 7d08eb429), reduced from behav_d44_map_traversal_views:
use std.collections
var m: HashMap[str, i32] = HashMap.new()
m.insert("alpha".to_owned(), 1)
let doubled = [v * 2 for (k, v) in m]
print(f"{doubled:?}")
Call parameter type does not match function signature!
i32 2
ptr %106 = call { ptr, i1 } @llvm.smul.with.overflow.p0(ptr …, i32 2)
error: LLVM function verification failed after MIR cleanup for main
With an explicit fn main holding the same statements over a module-level var m it compiles and runs. Under D184 doubled is itself a script global: its initializer (the comprehension, whose (k, v) are &K/&V views, D44) is type-checked in the decl pass as a global initializer and lowered in main by the script-init statement; the view-to-value materialization of v (D22) does not reach that lowering, so v * 2 multiplies the pointer. The main MIR shows the comprehension's iterator types numbered from the decl pass (ty1640…) where the explicit-main variant has main's (ty6452…).
with analyze repro.w audit:resolution reports violations=0 ok on this program, so the operand-type check misses a MIR operand whose type is not what Sema gave the expression; that silence is a bug of its own (AGENTS.md: a tool that stayed silent).
Likely fix shape: check a script-init initializer in main's body context (as the statement that assigns the global), typing the global from it on demand for helpers checked earlier, instead of checking it as a D175 initializer body and lowering it elsewhere.
Already fixed on main by the D184 landing (the repro prints [2] under the installed compiler); pinned in #3064 by test/behavior/behav_2978_script_map_comprehension.w.
Activity
#2977, #3052 (D195), #2636, #2978: concurrency evidence by reach, @[s…
ehartford commentedon Nov 7, 2026
Already fixed on main by the D184 landing (the repro prints
[2]under the installed compiler); pinned in #3064 by test/behavior/behav_2978_script_map_comprehension.w.