Could function pointers with anyopaque parameter accept functions with opaque pointer?
Ziggit
Could function pointers with anyopaque parameter accept functions with opaque pointer?
Since *Opaque automatically coerces to *anyopaque on assignment, it feels like *const fn (*Opaque) void should also automatically coerce to *const fn (context: *anyopaque) void const Opaque = opaque {}; fn testFn() void { const impl: *Opaque = undefined; // opaque ptr is trivially assignable to anyopaque ptr const opaq: *anyopaque = impl; _ = opaq; const implFn: *const fn (context: *Opaque) void = undefined; // error: expected type '*const fn (*anyopaque) void', found '...
0 comments
No comments yet.