// issue-0045 — calling a comptime fn whose body is a block // containing an explicit `return X;` trips LLVM's "Terminator found // in the middle of a basic block" verifier. // // Surfaced by the variadic heterogeneous type packs feature (step // 1 made `..$args` parseable, so the simplest pack-fn smoke test // exercised the bug). The root cause is broader than packs: ANY // comptime fn with `is_comptime` params, a non-void return, and a // block body with `return X;` had the same crash. `format`/`print` // use arrow form (`=> expr`) or `#insert`-only bodies, so the bug // was invisible until pack-fn bodies surfaced it. // // Once fixed, calling foo() reaches the body's `return 42;`, the // inliner stores 42 into a result slot, the caller loads it as the // inline value, and main prints "42". #import "modules/std.sx"; foo :: (..$args) -> s64 { return 42; } main :: () -> s32 { n : s64 = foo(1, "hello"); print("{}\n", n); return 0; }