| ... | ... | @@ -364,10 +364,8 @@ test "std.meta.activeTag" { |
| 364 | 364 | |
| 365 | 365 | ///Given a tagged union type, and an enum, return the type of the union |
| 366 | 366 | /// field corresponding to the enum tag. |
| 367 | | pub fn TagPayloadType(comptime U: type, tag: var) type { |
| 368 | | const Tag = @TypeOf(tag); |
| 367 | pub fn TagPayloadType(comptime U: type, tag: @TagType(U)) type { |
| 369 | 368 | testing.expect(trait.is(builtin.TypeId.Union)(U)); |
| 370 | | testing.expect(trait.is(builtin.TypeId.Enum)(Tag)); |
| 371 | 369 | |
| 372 | 370 | const info = @typeInfo(U).Union; |
| 373 | 371 | |