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

#write test.zig {
fn S(comptime PtrTy: type) type {
    return struct {
        fnPtr: PtrTy,
        a: u8,
    };
}
fn bar() void {}

fn foo(a: u8, comptime PtrTy: type) S(PtrTy) {
    return .{ .fnPtr = bar, .a = a };
}
export fn entry() void {
    var a: u8 = 1;
    _ = &a;
    _ = foo(a, fn () void);
}
#}
#update
#check errors {
test.zig:15:13: error: unable to resolve comptime value
test.zig:15:12: note: call to generic function instantiated with comptime-only return type 'test.S(fn () void)' is evaluated at comptime
test.zig:9:38: note: return type declared here
test.zig:3:16: note: struct requires comptime because of this field
test.zig:3:16: note: use '*const fn () void' for a function pointer type
#}
