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

#write test.zig {
export fn a() void {
    const p: *fn () void = @ptrFromInt(4);
    p.* = undefined;
}

export fn b(p: *anyopaque) void {
    p.* = undefined;
}

export fn c(p: *anyopaque, q: *anyopaque) void {
    p.* = q.*;
}

const Opaque = opaque {};
export fn d(p: *Opaque) void {
    p.* = undefined;
}

export fn e() void {
    const p: *comptime_int = @ptrFromInt(16);
    p.* = undefined;
}
#}
#update
#check errors {
test.zig:3:9: error: cannot store comptime-only type 'fn () void' at runtime
test.zig:3:6: note: operation is runtime due to this pointer
test.zig:7:11: error: expected type 'anyopaque', found '@TypeOf(undefined)'
test.zig:7:11: note: cannot coerce to uninstantiable type 'anyopaque'
test.zig:11:12: error: cannot load opaque type 'anyopaque'
test.zig:16:11: error: expected type 'test.Opaque', found '@TypeOf(undefined)'
test.zig:16:11: note: cannot coerce to uninstantiable type 'test.Opaque'
test.zig:14:16: note: opaque declared here
test.zig:21:9: error: cannot store comptime-only type 'comptime_int' at runtime
test.zig:21:6: note: operation is runtime due to this pointer
#}
