zig/test/behavior/bugs/679.zig
2021-06-21 17:03:03 -07:00

19 lines
357 B
Zig

const std = @import("std");
const expect = std.testing.expect;
pub fn List(comptime T: type) type {
_ = T;
return u32;
}
const ElementList = List(Element);
const Element = struct {
link: ElementList,
};
test "false dependency loop in struct definition" {
const listType = ElementList;
var x: listType = 42;
try expect(x == 42);
}