aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/addition_with_non_numbers.zig
blob: 170220e9e6eadee6554c375623951b31e24706a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const Foo = struct {
    field: i32,
};
const x = Foo{ .field = 1 } + Foo{ .field = 2 };

export fn entry() usize {
    return @sizeOf(@TypeOf(x));
}

// error
//
// :4:29: error: invalid operands to binary expression: 'struct' and 'struct'