zig/test/behavior/bugs/679.zig

18 lines
346 B
Zig
Raw Normal View History

const std = @import("std");
const expect = std.testing.expect;
pub fn List(comptime T: type) type {
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);
}