master
 1const builtin = @import("builtin");
 2const expect = @import("std").testing.expect;
 3
 4const A = struct {
 5    b: B,
 6};
 7
 8const B = struct {
 9    c: C,
10};
11
12const C = struct {
13    x: i32,
14
15    fn d(c: *const C) i32 {
16        return c.x;
17    }
18};
19
20fn foo(a: A) i32 {
21    return a.b.c.d();
22}
23
24test "incomplete struct param top level declaration" {
25    if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
26
27    const a = A{
28        .b = B{
29            .c = C{ .x = 13 },
30        },
31    };
32    try expect(foo(a) == 13);
33}