aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/addition_with_non_numbers.zig
blob: 3687df914f25e81b4e184f89ceae95304aca0b17 (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
// backend=llvm
// target=native
//
// :4:28: error: invalid operands to binary expression: 'Struct' and 'Struct'