diff options
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/type.zig b/src/type.zig index 0ce242b616..f285caff95 100644 --- a/src/type.zig +++ b/src/type.zig @@ -288,7 +288,51 @@ pub const Type = struct { } try writer.writeAll("}"); }, - .simple_type => |s| return writer.writeAll(@tagName(s)), + .simple_type => |s| switch (s) { + .f16, + .f32, + .f64, + .f80, + .f128, + .usize, + .isize, + .c_char, + .c_short, + .c_ushort, + .c_int, + .c_uint, + .c_long, + .c_ulong, + .c_longlong, + .c_ulonglong, + .c_longdouble, + .anyopaque, + .bool, + .void, + .type, + .anyerror, + .comptime_int, + .comptime_float, + .noreturn, + => return writer.writeAll(@tagName(s)), + .null, + .undefined, + => try writer.print("@TypeOf({s})", .{@tagName(s)}), + .enum_literal => try writer.print("@TypeOf(.{s})", .{@tagName(s)}), + .atomic_order, + .atomic_rmw_op, + .calling_convention, + .address_space, + .float_mode, + .reduce_op, + .call_modifier, + .prefetch_options, + .export_options, + .extern_options, + .type_info, + .generic_poison, + => unreachable, + }, .struct_type => |struct_type| { if (mod.structPtrUnwrap(struct_type.index)) |struct_obj| { const decl = mod.declPtr(struct_obj.owner_decl); |
