mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
20 lines
369 B
Zig
20 lines
369 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;
|
|
_ = &x;
|
|
try expect(x == 42);
|
|
}
|