zig/doc/langref/test_opaque.zig

14 lines
244 B
Zig

const Derp = opaque {};
const Wat = opaque {};
extern fn bar(d: *Derp) void;
fn foo(w: *Wat) callconv(.C) void {
bar(w);
}
test "call foo" {
foo(undefined);
}
// test_error=expected type '*test_opaque.Derp', found '*test_opaque.Wat'