master
1// zig fmt: off
2comptime { _ = @min(0, u32); } // type
3comptime { _ = @max(0, {}); } // void
4comptime { _ = @min(0, false); } // boolean
5comptime { _ = @min(0, &@as(u8, 0)); } // pointer
6comptime { _ = @max(0, [0]u8{}); } // array
7comptime { _ = @min(0, Struct{}); } // struct
8comptime { _ = @max(0, null); } // null
9comptime { _ = @min(0, @as(?u8, 0)); } // nullable
10comptime { _ = @max(0, @as(error{}!u8, 0)); } // error union
11comptime { _ = @min(0, error.Foo); } // error set
12comptime { _ = @max(0, Enum.foo); } // enum
13comptime { _ = @min(0, Union{ .foo = {} }); } // union
14comptime { _ = @max(0, struct { fn func() u8 { return 42; }}.func); }
15comptime { _ = @max(0, .foo); } // enum literal
16
17const Struct = struct {};
18const Enum = enum { foo };
19const Union = union { foo: void };
20
21// error
22//
23// :2:24: error: expected number, found 'type'
24// :3:24: error: expected number, found 'void'
25// :4:24: error: expected number, found 'bool'
26// :5:24: error: expected number, found '*const u8'
27// :6:29: error: expected number, found '[0]u8'
28// :7:30: error: expected number, found 'tmp.Struct'
29// :17:16: note: struct declared here
30// :8:24: error: expected number, found '@TypeOf(null)'
31// :9:24: error: expected number, found '?u8'
32// :10:24: error: expected number, found 'error{}!u8'
33// :11:24: error: expected number, found 'error{Foo}'
34// :12:28: error: expected number, found 'tmp.Enum'
35// :18:14: note: enum declared here
36// :13:29: error: expected number, found 'tmp.Union'
37// :19:15: note: union declared here
38// :14:61: error: expected number, found 'fn () u8'
39// :15:25: error: expected number, found '@EnumLiteral()'