-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Milestone
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior