#zig build-obj {
--name test -fno-emit-bin
-Mroot=test.zig
#}

#write test.zig {
const S = struct {
    fnPtr: fn () void,
};
fn bar() void {}
fn baz() void {}
var runtime: bool = true;
fn ifExpr() S {
    if (runtime) {
        return .{
            .fnPtr = bar,
        };
    } else {
        return .{
            .fnPtr = baz,
        };
    }
}
export fn entry1() void {
    _ = ifExpr();
}
fn switchExpr() S {
    switch (runtime) {
        true => return .{
            .fnPtr = bar,
        },
        false => return .{
            .fnPtr = baz,
        },
    }
}
export fn entry2() void {
    _ = switchExpr();
}
#}
#update
#check errors {
test.zig:8:9: error: unable to resolve comptime value
test.zig:19:15: note: called at comptime from here
test.zig:19:15: note: call to function with comptime-only return type 'test.S' is evaluated at comptime
test.zig:7:13: note: return type declared here
test.zig:2:12: note: struct requires comptime because of this field
test.zig:2:12: note: use '*const fn () void' for a function pointer type
test.zig:22:13: error: unable to resolve comptime value
test.zig:32:19: note: called at comptime from here
test.zig:32:19: note: call to function with comptime-only return type 'test.S' is evaluated at comptime
test.zig:21:17: note: return type declared here
test.zig:2:12: note: struct requires comptime because of this field
test.zig:2:12: note: use '*const fn () void' for a function pointer type
#}
