diff options
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 39bbf504b8..946f55f9fd 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1513,6 +1513,42 @@ pub fn main(args: [][]u8) -> %void { %%stdout.printf("OK\n"); } )SOURCE", "OK\n"); + + + add_simple_case("incomplete struct parameter top level decl", R"SOURCE( +import "std.zig"; +struct A { + b: B, +} + +struct B { + c: C, +} + +struct C { + x: i32, + + fn d(c: C) { + %%stdout.printf("OK\n"); + } +} + +fn foo(a: A) { + a.b.c.d(); +} + +pub fn main(args: [][]u8) -> %void { + const a = A { + .b = B { + .c = C { + .x = 13, + }, + }, + }; + foo(a); +} + + )SOURCE", "OK\n"); } |
