| ... | ... | @@ -418,12 +418,9 @@ test fieldInfo { |
| 418 | 418 | try testing.expect(comptime uf.type == u8); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | /// Deprecated: use @FieldType |
| 421 | 422 | pub fn FieldType(comptime T: type, comptime field: FieldEnum(T)) type { |
| 422 | | if (@typeInfo(T) != .@"struct" and @typeInfo(T) != .@"union") { |
| 423 | | @compileError("Expected struct or union, found '" ++ @typeName(T) ++ "'"); |
| 424 | | } |
| 425 | | |
| 426 | | return fieldInfo(T, field).type; |
| 423 | return @FieldType(T, @tagName(field)); |
| 427 | 424 | } |
| 428 | 425 | |
| 429 | 426 | test FieldType { |