| 1 | #exe { |
| 2 | --name types |
| 3 | -Mroot=types.zig |
| 4 | #} |
| 5 | |
| 6 | #write types.zig { |
| 7 | fn testTypes( |
| 8 | Anyopaque: type, |
| 9 | Bool: type, |
| 10 | Void: type, |
| 11 | Type: type, |
| 12 | ComptimeInt: type, |
| 13 | ComptimeFloat: type, |
| 14 | Noreturn: type, |
| 15 | Null: type, |
| 16 | Undefined: type, |
| 17 | EnumLiteral: type, |
| 18 | ) void { |
| 19 | _ = Anyopaque; |
| 20 | _ = Bool; |
| 21 | _ = Void; |
| 22 | _ = Type; |
| 23 | _ = ComptimeInt; |
| 24 | _ = ComptimeFloat; |
| 25 | _ = Noreturn; |
| 26 | _ = Null; |
| 27 | _ = Undefined; |
| 28 | _ = EnumLiteral; |
| 29 | } |
| 30 | pub fn main() void { |
| 31 | testTypes( |
| 32 | anyopaque, |
| 33 | bool, |
| 34 | void, |
| 35 | type, |
| 36 | comptime_int, |
| 37 | comptime_float, |
| 38 | noreturn, |
| 39 | @TypeOf(null), |
| 40 | @TypeOf(undefined), |
| 41 | @EnumLiteral(), |
| 42 | ); |
| 43 | } |
| 44 | #} |
| 45 | #update |
| 46 | #check lldb { |
| 47 | (lldb) breakpoint set --file types.zig --source-pattern-regexp '_ = Undefined;' |
| 48 | Breakpoint 1: where = types`types.testTypes#... + #... at types.zig:23:1, address = 0x#... |
| 49 | (lldb) process launch |
| 50 | Process #... launched: '#.../types' (#...) |
| 51 | Process #... stopped |
| 52 | * thread #1, name = 'types', stop reason = breakpoint 1.1 |
| 53 | frame #0: types`types.testTypes#...(anyopaque=anyopaque, bool=bool, void=void, type=type, comptime_int=comptime_int, comptime_float=comptime_float, noreturn=noreturn, @TypeOf(null)=@TypeOf(null), @TypeOf(undefined)=@TypeOf(undefined), @EnumLiteral()=@EnumLiteral()) at types.zig:23:1 |
| 54 | (lldb) frame variable --show-all-children --show-types -- Anyopaque Bool Void Type ComptimeInt ComptimeFloat Noreturn Null Undefined EnumLiteral |
| 55 | (type) Anyopaque = anyopaque |
| 56 | (type) Bool = bool |
| 57 | (type) Void = void |
| 58 | (type) Type = type |
| 59 | (type) ComptimeInt = comptime_int |
| 60 | (type) ComptimeFloat = comptime_float |
| 61 | (type) Noreturn = noreturn |
| 62 | (type) Null = @TypeOf(null) |
| 63 | (type) Undefined = @TypeOf(undefined) |
| 64 | (type) EnumLiteral = @EnumLiteral() |
| 65 | (lldb) breakpoint delete --force 1 |
| 66 | 1 breakpoints deleted; 0 breakpoint locations disabled. |
| 67 | #} |