Sema: fix fieldCallBind on tuples and anon structs

Closes #12573
This commit is contained in:
Veikka Tuominen
2022-08-22 11:13:01 +03:00
parent 560baf67ce
commit 5404dcdfd8
2 changed files with 31 additions and 7 deletions

View File

@@ -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'