It looks the answer is no. But I’m not sure if there is a way.
const print = @import("std").debug.print;
// Arbuments passed to v will always be evaluated,
// regardless of what the value b is, even if it is comptime.
inline fn foo(b: bool, v: u8) u8 {
if (b) return v;
return 0;
}
fn bar() u8 {
print("bar\n", .{}); // being printed
return 1;
}
pub fn main() void {
const x = foo(false, bar());
print("x = {}\n", .{x});
}