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
Calling an instance method as Type.method() passes Sema and fails in the LLVM verifier #1201
type P { n: i32 }
impl P:
fn new() -> P: P { n: 0 } // inside an impl this is an instance method (implicit &self)
fn main:
let p = P.new()
print(f"{p.n}")
Actual (seen building the compiler with this shape in src/CImport.w):
error: Incorrect number of arguments passed to called function!
%232 = call %CiMacroProbes @"__wcu$2428$CiMacroProbes.new"(), !dbg !4394
error: LLVM function verification failed after MIR cleanup for ci_translate_macros
Expected: a source diagnostic at the call — P.new() names an instance method and supplies no receiver; suggest the constructor spelling fn P.new() -> P — never an invalid LLVM function. The MIR validators also passed this call with a missing receiver argument, so --validate-all has a gap here too.
Correction to the report: the tools were not silent. with analyze <file> audit:all reports this exact call ("violation: body 746 call 0: argument/signature mismatch args=0 params=1"). Only Sema accepted it. Fix is on branch fix-1201-static-call-of-instance-method: the static-receiver path checks the resolved signature's receiver mode.
Activity
ehartford commentedon Sep 19, 2026
Correction to the report: the tools were not silent.
with analyze <file> audit:allreports this exact call ("violation: body 746 call 0: argument/signature mismatch args=0 params=1"). Only Sema accepted it. Fix is on branchfix-1201-static-call-of-instance-method: the static-receiver path checks the resolved signature's receiver mode.