diff options
| author | Veikka Tuominen <git@vexu.eu> | 2021-06-13 22:27:27 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-06-14 00:16:40 +0300 |
| commit | e63ff4f1c110165c4b92025cb5b9d5531e861643 (patch) | |
| tree | 277384b63ba8398200de8e9adc36110597f4470b /src/type.zig | |
| parent | b9f07b7ac227134001258e5933e3ef61aae80303 (diff) | |
| download | zig-e63ff4f1c110165c4b92025cb5b9d5531e861643.tar.gz zig-e63ff4f1c110165c4b92025cb5b9d5531e861643.zip | |
add ast-check flag to zig fmt, fix found bugs
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/type.zig b/src/type.zig index 3e6c810b20..410773b649 100644 --- a/src/type.zig +++ b/src/type.zig @@ -6,6 +6,8 @@ const Target = std.Target; const Module = @import("Module.zig"); const log = std.log.scoped(.Type); +const file_struct = @This(); + /// This is the raw data, with no bookkeeping, no memory awareness, no de-duplication. /// It's important for this type to be small. /// Types are not de-duplicated, which helps with multi-threading since it obviates the requirement @@ -3000,12 +3002,12 @@ pub const Type = extern union { }; } - pub fn init(comptime t: Tag) Type { + pub fn init(comptime t: Tag) file_struct.Type { comptime std.debug.assert(@enumToInt(t) < Tag.no_payload_count); return .{ .tag_if_small_enough = @enumToInt(t) }; } - pub fn create(comptime t: Tag, ally: *Allocator, data: Data(t)) error{OutOfMemory}!Type { + pub fn create(comptime t: Tag, ally: *Allocator, data: Data(t)) error{OutOfMemory}!file_struct.Type { const ptr = try ally.create(t.Type()); ptr.* = .{ .base = .{ .tag = t }, |
