aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/679.zig
blob: 6420e7f99f056751c8a8910b06feffb510f7e701 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
}