| ... | ... | @@ -693,8 +693,10 @@ test activeTag { |
| 693 | 693 | try testing.expect(activeTag(u) == UE.Float); |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | /// Deprecated: Use @FieldType(U, tag_name) |
| 696 | 697 | const TagPayloadType = TagPayload; |
| 697 | 698 | |
| 699 | /// Deprecated: Use @FieldType(U, tag_name) |
| 698 | 700 | pub fn TagPayloadByName(comptime U: type, comptime tag_name: []const u8) type { |
| 699 | 701 | const info = @typeInfo(U).@"union"; |
| 700 | 702 | |
| ... | ... | @@ -706,8 +708,7 @@ pub fn TagPayloadByName(comptime U: type, comptime tag_name: []const u8) type { |
| 706 | 708 | @compileError("no field '" ++ tag_name ++ "' in union '" ++ @typeName(U) ++ "'"); |
| 707 | 709 | } |
| 708 | 710 | |
| 709 | | /// Given a tagged union type, and an enum, return the type of the union field |
| 710 | | /// corresponding to the enum tag. |
| 711 | /// Deprecated: Use @FieldType(U, @tagName(tag)) |
| 711 | 712 | pub fn TagPayload(comptime U: type, comptime tag: Tag(U)) type { |
| 712 | 713 | return TagPayloadByName(U, @tagName(tag)); |
| 713 | 714 | } |