| ... | @@ -361,21 +361,7 @@ const DocData = struct { | ... | @@ -361,21 +361,7 @@ const DocData = struct { |
| 361 | /// `ComptimeExpr` represents the result of a piece of comptime logic | 361 | /// `ComptimeExpr` represents the result of a piece of comptime logic |
| 362 | /// that we weren't able to analyze fully. Examples of that are comptime | 362 | /// that we weren't able to analyze fully. Examples of that are comptime |
| 363 | /// function calls and comptime if / switch / ... expressions. | 363 | /// function calls and comptime if / switch / ... expressions. |
| 364 | const DocTypeKinds = blk: { | 364 | const DocTypeKinds = @typeInfo(Type).Union.tag_type.?; |
| 365 | var info = @typeInfo(std.builtin.TypeId); | | |
| 366 | const original_len = info.Enum.fields.len; | | |
| 367 | info.Enum.fields = info.Enum.fields ++ [2]std.builtin.TypeInfo.EnumField{ | | |
| 368 | .{ | | |
| 369 | .name = "ComptimeExpr", | | |
| 370 | .value = original_len, | | |
| 371 | }, | | |
| 372 | .{ | | |
| 373 | .name = "Unanalyzed", | | |
| 374 | .value = original_len + 1, | | |
| 375 | }, | | |
| 376 | }; | | |
| 377 | break :blk @Type(info); | | |
| 378 | }; | | |
| 379 | | 365 | |
| 380 | const ComptimeExpr = struct { | 366 | const ComptimeExpr = struct { |
| 381 | code: []const u8, | 367 | code: []const u8, |
| ... | @@ -433,7 +419,7 @@ const DocData = struct { | ... | @@ -433,7 +419,7 @@ const DocData = struct { |
| 433 | @"comptime": bool = false, | 419 | @"comptime": bool = false, |
| 434 | }; | 420 | }; |
| 435 | | 421 | |
| 436 | const Type = union(DocTypeKinds) { | 422 | const Type = union(enum) { |
| 437 | Unanalyzed: struct {}, | 423 | Unanalyzed: struct {}, |
| 438 | Type: struct { name: []const u8 }, | 424 | Type: struct { name: []const u8 }, |
| 439 | Void: struct { name: []const u8 }, | 425 | Void: struct { name: []const u8 }, |