You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const A = struct {
b: B,
};
const B = fn(A) void;
pub fn main() void {
//var a: A = undefined; // uncomment this line for: segfault
//var b: B = undefined; // uncomment this line for: error: 'B' depends on itself
}
const B = fn(*A) void; // changing the definition of B slightly, now the below compiles without a segfault or compile errors
pub fn main() void {
var a: A = undefined;
}
This code should compile. In fact B looks a lot like a virtual function taking a 'this' by value or by pointer. translate-c on uv.h (libuv) gives the error "uv_close_cb depends on itself" which is how I came across this bug.
The text was updated successfully, but these errors were encountered:
This code should compile. In fact B looks a lot like a virtual function taking a 'this' by value or by pointer. translate-c on uv.h (libuv) gives the error "uv_close_cb depends on itself" which is how I came across this bug.
The text was updated successfully, but these errors were encountered: