aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/bogus_method_call_on_slice.zig
blob: 62adaa3d3e4e5bfb84af4309175e650271ebc99d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var self = "aoeu";

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();
}

const S = struct { foo: i32 };
pub export fn entry2() void {
    const x = S{ .foo = 1 };
    x.bar();
}

// error
//
// :4:6: error: no field or member function named 'copy' in '[]const u8'
// :12:8: error: no field or member function named 'bar' in '@TypeOf(.{})'
// :18:6: error: no field or member function named 'bar' in 'tmp.S'
// :15:11: note: struct declared here