| ... | ... | @@ -1816,6 +1816,14 @@ const Point = struct { x: i32, y: i32, }; |
| 1816 | 1816 | fn foo(p: Point) { } |
| 1817 | 1817 | export fn entry() -> usize { @sizeOf(@typeOf(foo)) } |
| 1818 | 1818 | )SOURCE", 1, ".tmp_source.zig:3:11: error: type 'Point' is not copyable; cannot pass by value"); |
| 1819 | |
| 1820 | add_compile_fail_case("implicit cast from array to mutable slice", R"SOURCE( |
| 1821 | var global_array: [10]i32 = undefined; |
| 1822 | fn foo(param: []i32) {} |
| 1823 | export fn entry() { |
| 1824 | foo(global_array); |
| 1825 | } |
| 1826 | )SOURCE", 1, ".tmp_source.zig:5:9: error: expected type '[]i32', found '[10]i32'"); |
| 1819 | 1827 | } |
| 1820 | 1828 | |
| 1821 | 1829 | ////////////////////////////////////////////////////////////////////////////// |