const std = @import("std");
const A = struct {
b_map: ?Map, // line a: comment this line and the compiler crashes
};
const B = struct {
a_ptr: *A,
};
const Map = std.AutoHashMap(*B, void);
test "Test" {
// var a = A{ .b_map = null }; // line b: uncomment this line and no more dependency error
var b_s = Map.init(std.testing.allocator);
defer b_s.deinit();
}
zig test main.zig gives an error:
main.zig:4:13: error: dependency loop detected ....
Now uncomment line b, zig test main.zig is ok, All 1 tests passed.
I guess the size of the structs should be known at comptime.
By the way: uncomment line a and line b and zig test main.zig crashes
main.zig:
zig test main.zig gives an error: main.zig:4:13: error: dependency loop detected ....
Now uncomment line b, zig test main.zig is ok, All 1 tests passed.
I guess the size of the structs should be known at comptime.
By the way: uncomment line a and line b and zig test main.zig crashes
zig version 0.6.0+749417a1f