| 1 | const x: Foo = .{}; |
| 2 | const y: Foo = .{}; |
| 3 | |
| 4 | export fn a() void { |
| 5 | _ = x > y; |
| 6 | } |
| 7 | |
| 8 | export fn b() void { |
| 9 | _ = x < y; |
| 10 | } |
| 11 | |
| 12 | export fn c() void { |
| 13 | _ = x >= y; |
| 14 | } |
| 15 | export fn d() void { |
| 16 | _ = x <= y; |
| 17 | } |
| 18 | |
| 19 | const 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 |