| ... | ... | @@ -838,6 +838,17 @@ struct A { b : B, } |
| 838 | 838 | struct B { c : C, } |
| 839 | 839 | struct C { a : A, } |
| 840 | 840 | )SOURCE", 1, ".tmp_source.zig:2:1: error: struct has infinite size"); |
| 841 | |
| 842 | add_compile_fail_case("invalid struct field", R"SOURCE( |
| 843 | struct A { x : i32, } |
| 844 | fn f() { |
| 845 | var a : A; |
| 846 | a.foo = 1; |
| 847 | const y = a.bar; |
| 848 | } |
| 849 | )SOURCE", 2, |
| 850 | ".tmp_source.zig:5:6: error: no member named 'foo' in 'A'", |
| 851 | ".tmp_source.zig:6:16: error: no member named 'bar' in 'A'"); |
| 841 | 852 | } |
| 842 | 853 | |
| 843 | 854 | static void print_compiler_invocation(TestCase *test_case) { |