diff options
| author | Veikka Tuominen <git@vexu.eu> | 2023-11-29 20:40:57 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2023-11-30 13:15:40 +0200 |
| commit | 39a966b0a496b683d0ac0d1b04dc851caa655a23 (patch) | |
| tree | a53abaa7edc89af1a4d44e2a4853ed29ace10e9b /test/cases/compile_errors/array_cat_invalid_elem.zig | |
| parent | 1e42a3de89e8a4e78b76d8fc5192bbacf842c02b (diff) | |
| download | zig-39a966b0a496b683d0ac0d1b04dc851caa655a23.tar.gz zig-39a966b0a496b683d0ac0d1b04dc851caa655a23.zip | |
Sema: improve error location for array cat/mul
Diffstat (limited to 'test/cases/compile_errors/array_cat_invalid_elem.zig')
| -rw-r--r-- | test/cases/compile_errors/array_cat_invalid_elem.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/cases/compile_errors/array_cat_invalid_elem.zig b/test/cases/compile_errors/array_cat_invalid_elem.zig new file mode 100644 index 0000000000..fc5b99a68b --- /dev/null +++ b/test/cases/compile_errors/array_cat_invalid_elem.zig @@ -0,0 +1,17 @@ +const Foo = enum { a }; +pub export fn entry1() void { + const arr = [_]Foo{.a}; + _ = arr ++ .{.b}; +} +pub export fn entry2() void { + const b = .{.b}; + const arr = [_]Foo{.a}; + _ = arr ++ b; +} + +// error +// +// :4:19: error: no field named 'b' in enum 'tmp.Foo' +// :1:13: note: enum declared here +// :9:16: error: no field named 'b' in enum 'tmp.Foo' +// :1:13: note: enum declared here |
