// Repro for issue 0151 — UFCS dot-call where `$R` is inferred from a // worker closure's RETURN type through a variadic `..$args` pack leaves // `$R` unresolved (SIGTRAP at LLVM emission). The DIRECT spelling // `mymk(bx, worker, 40, 2)` resolves `$R = i64` and works; the UFCS // spelling `bx.mymk(worker, 40, 2)` does not. Depends on no project // symbols beyond modules/std.sx. #import "modules/std.sx"; Box :: struct { n: i64; } Wrap :: struct ($R: Type) { value: R; } mymk :: ufcs (b: Box, worker: Closure(..$args) -> $R, ..$args) -> Wrap($R) { f : Wrap($R) = ---; f.value = worker(..args); return f; } main :: () -> i32 { bx : Box = .{ n = 1 }; g := bx.mymk((a: i64, b: i64) -> i64 => a + b, 40, 2); print("value={}\n", g.value); return 0; }