| ... | ... | @@ -841,7 +841,7 @@ const x : i32 = 99; |
| 841 | 841 | fn f() { |
| 842 | 842 | x = 1; |
| 843 | 843 | } |
| 844 | | )SOURCE", 1, ".tmp_source.zig:4:5: error: cannot assign to constant"); |
| 844 | )SOURCE", 1, ".tmp_source.zig:4:7: error: cannot assign to constant"); |
| 845 | 845 | |
| 846 | 846 | |
| 847 | 847 | add_compile_fail_case("missing else clause", R"SOURCE( |
| ... | ... | @@ -849,18 +849,18 @@ fn f(b: bool) { |
| 849 | 849 | const x : i32 = if (b) { 1 }; |
| 850 | 850 | const y = if (b) { i32(1) }; |
| 851 | 851 | } |
| 852 | | )SOURCE", 2, ".tmp_source.zig:3:21: error: expected type 'i32', found 'void'", |
| 852 | )SOURCE", 2, ".tmp_source.zig:3:30: error: integer value 1 cannot be implicitly casted to type 'void'", |
| 853 | 853 | ".tmp_source.zig:4:15: error: incompatible types: 'i32' and 'void'"); |
| 854 | 854 | |
| 855 | 855 | add_compile_fail_case("direct struct loop", R"SOURCE( |
| 856 | 856 | const A = struct { a : A, }; |
| 857 | | )SOURCE", 1, ".tmp_source.zig:2:1: error: 'A' depends on itself"); |
| 857 | )SOURCE", 1, ".tmp_source.zig:2:11: error: struct 'A' contains itself"); |
| 858 | 858 | |
| 859 | 859 | add_compile_fail_case("indirect struct loop", R"SOURCE( |
| 860 | 860 | const A = struct { b : B, }; |
| 861 | 861 | const B = struct { c : C, }; |
| 862 | 862 | const C = struct { a : A, }; |
| 863 | | )SOURCE", 1, ".tmp_source.zig:2:1: error: 'A' depends on itself"); |
| 863 | )SOURCE", 1, ".tmp_source.zig:2:11: error: struct 'A' contains itself"); |
| 864 | 864 | |
| 865 | 865 | add_compile_fail_case("invalid struct field", R"SOURCE( |
| 866 | 866 | const A = struct { x : i32, }; |