master
1const x: Foo = .{};
2const y: Foo = .{};
3
4export fn a() void {
5 _ = x > y;
6}
7
8export fn b() void {
9 _ = x < y;
10}
11
12export fn c() void {
13 _ = x >= y;
14}
15export fn d() void {
16 _ = x <= y;
17}
18
19const Foo = packed struct {
20 a: u4 = 10,
21 b: u4 = 5,
22};
23
24// error
25//
26// :5:11: error: operator > not allowed for type 'tmp.Foo'
27// :19:20: note: struct declared here
28// :9:11: error: operator < not allowed for type 'tmp.Foo'
29// :19:20: note: struct declared here
30// :13:11: error: operator >= not allowed for type 'tmp.Foo'
31// :19:20: note: struct declared here
32// :16:11: error: operator <= not allowed for type 'tmp.Foo'
33// :19:20: note: struct declared here