| ... | @@ -68,7 +68,7 @@ pub fn isTag(tagged_value: anytype, comptime tag_name: []const u8) bool { | ... | @@ -68,7 +68,7 @@ pub fn isTag(tagged_value: anytype, comptime tag_name: []const u8) bool { |
| 68 | const type_name = @typeName(T); | 68 | const type_name = @typeName(T); |
| 69 | | 69 | |
| 70 | // select the Enum type out of the type (in the case of the tagged union, extract it) | 70 | // select the Enum type out of the type (in the case of the tagged union, extract it) |
| 71 | const E = if (.Enum == type_info) T else if (.Union == type_info) (if (type_info.Union.tag_type) |TT| TT else { | 71 | const E = if (.Enum == type_info) T else if (.Union == type_info) (type_info.Union.tag_type orelse { |
| 72 | @compileError("attempted to use isTag on the untagged union " ++ type_name); | 72 | @compileError("attempted to use isTag on the untagged union " ++ type_name); |
| 73 | }) else { | 73 | }) else { |
| 74 | @compileError("attempted to use isTag on a value of type (" ++ type_name ++ ") that isn't an enum or a union."); | 74 | @compileError("attempted to use isTag on a value of type (" ++ type_name ++ ") that isn't an enum or a union."); |