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
with check accepts method calls with the wrong argument count; fails late at LLVM verification #1973
with check accepts a method call with the wrong number of arguments. The program fails only at LLVM verification when it is built, or not at all under the comptime evaluator. A free-function call is checked correctly.
Spec: §3.8 (parameters), §20 (diagnostics). A call that does not match its callee's parameter list is a type error.
Minimal repro (main 9307016, stage1; the pinned seed behaves the same):
type Ev { n: i32 }
impl Ev:
mut fn make(a: i32, b: i64) -> i32: a + b as i32
mut fn run() -> i32: self.make(3)
fn main:
var e = Ev { n: 0 }
print(e.run())
with check repro.w prints ok, rc 0.
with run repro.w fails with Incorrect number of arguments passed to called function!%1 = call i32 @Ev.make(ptr %0, i32 3)===== INVALID LLVM FUNCTION Ev.run =====.
Matrix (all print ok from check):
call
callee
self.make(3)
mut fn make(a, b)
self.peek(3)
fn peek(a, b)
e.make(3)
mut fn make(a, b)
e.peek(3)
fn peek(a, b)
e.make(3, 4, 5)
too many arguments, same result
The free-function control, fn make(a: i32, b: i64) called as make(3), is rejected: error: function 'make' expects 2 argument(s), found 1.
Found during #1944. Changing an evaluator helper's signature left seven stale one-argument call sites. with check src/main.w passed; the :dev stage1 compile then died in the LLVM verifier for ComptimeEvaluator.eval_fn_symbol_call_values_with_resolved_type_args. Per D65, Sema owns acceptance. Today the wrong-arity call reaches MIR and codegen. audit:resolution should also have flagged the argument-count disagreement.
Expected: Sema rejects a method call whose argument count (receiver excluded, defaults applied) does not match the declaration, with the same diagnostic shape as the free-function case.
Workaround: none needed. The #1944 call sites were fixed by hand.
Another row of the same class, found while working #1457 (main 9307016, installed compiler): a static dotted function called through a value.
pub type Item { x: i64 }
pub fn Item.tag() -> str: "a"
fn main:
let i = Item { x: 1 }
print(i.tag())
with run: Incorrect number of arguments passed to called function!%1 = call %str @Item.tag(%Item ...)===== INVALID LLVM FUNCTION main =====. Item.tag() runs and prints a. with analyze ... audit:all reports it as resolution: MIR passes 1 argument(s) to Item.tag, Sema's signature takes 0 (D65; #1639's silent case), so audit:resolution sees it and Sema accepts it.
Fixed on main in c884c1c (stack #2001 → #2010, seed-driven battery GREEN on b932ef6, tree identical to main). Fixture coverage is in the stack's commits.
Activity
ehartford commentedon Oct 3, 2026
Another row of the same class, found while working #1457 (main 9307016, installed compiler): a static dotted function called through a value.
with run:Incorrect number of arguments passed to called function!%1 = call %str @Item.tag(%Item ...)===== INVALID LLVM FUNCTION main =====.Item.tag()runs and printsa.with analyze ... audit:allreports it asresolution: MIR passes 1 argument(s) to Item.tag, Sema's signature takes 0 (D65; #1639's silent case), so audit:resolution sees it and Sema accepts it.Comptime StringBuilder is one growable buffer; arena reads share text (…
Comptime StringBuilder is one growable buffer; arena reads share text (…
Sema: one arity rule for every call; method calls are checked (#1973)
Sema: defaults of a generic method are filled from its declaration (#…
Comptime StringBuilder is one growable buffer; arena reads share text (…
Sema: a method call refused for its count keeps its result type (#1973)
Sema: one arity check for every call path (#1973); owned ?? / unwrap_…
ehartford commentedon Oct 3, 2026
Fixed on main in c884c1c (stack #2001 → #2010, seed-driven battery GREEN on b932ef6, tree identical to main). Fixture coverage is in the stack's commits.