diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-08-22 11:13:01 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-08-22 14:31:58 +0300 |
| commit | 5404dcdfd844e4b9f47dc49a1f43f0e1075a563f (patch) | |
| tree | 06ee8b53580c6b5a31face3950520553a5d5a750 /test | |
| parent | 560baf67ce77de41da3d03183300cdf1b6d90567 (diff) | |
| download | zig-5404dcdfd844e4b9f47dc49a1f43f0e1075a563f.tar.gz zig-5404dcdfd844e4b9f47dc49a1f43f0e1075a563f.zip | |
Sema: fix fieldCallBind on tuples and anon structs
Closes #12573
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases/compile_errors/bogus_method_call_on_slice.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/cases/compile_errors/bogus_method_call_on_slice.zig b/test/cases/compile_errors/bogus_method_call_on_slice.zig index b5cb5e472a..ed18f43f48 100644 --- a/test/cases/compile_errors/bogus_method_call_on_slice.zig +++ b/test/cases/compile_errors/bogus_method_call_on_slice.zig @@ -3,9 +3,17 @@ fn f(m: []const u8) void { m.copy(u8, self[0..], m); } export fn entry() usize { return @sizeOf(@TypeOf(&f)); } +pub export fn entry1() void { + .{}.bar(); +} +pub export fn entry2() void { + .{ .foo = 1 }.bar(); +} // error // backend=stage2 // target=native // +// :7:8: error: no field or member function named 'bar' in '@TypeOf(.{})' +// :10:18: error: no field or member function named 'bar' in 'struct{comptime foo: comptime_int = 1}' // :3:6: error: no field or member function named 'copy' in '[]const u8' |
