@@ -85,16 +85,13 @@ fn ToUnsigned(comptime T: type) type {
8585pub fn FlexibleArrayType (comptime SelfType : type , comptime ElementType : type ) type {
8686 switch (@typeInfo (SelfType )) {
8787 .pointer = > | ptr | {
88- return @Type (.{ .pointer = .{
89- .size = .c ,
90- .is_const = ptr .is_const ,
91- .is_volatile = ptr .is_volatile ,
92- .alignment = @alignOf (ElementType ),
93- .address_space = .generic ,
94- .child = ElementType ,
95- .is_allowzero = true ,
96- .sentinel_ptr = null ,
97- } });
88+ return @Pointer (.c , .{
89+ .@"const" = ptr .is_const ,
90+ .@"volatile" = ptr .is_volatile ,
91+ .@"allowzero" = true ,
92+ .@"addrspace" = .generic ,
93+ .@"align" = @alignOf (ElementType ),
94+ }, ElementType , null );
9895 },
9996 else = > | info | @compileError ("Invalid self type \" " ++ @tagName (info ) ++ "\" for flexible array getter: " ++ @typeName (SelfType )),
10097 }
@@ -219,7 +216,7 @@ fn castInt(comptime DestType: type, target: anytype) DestType {
219216 const dest = @typeInfo (DestType ).int ;
220217 const source = @typeInfo (@TypeOf (target )).int ;
221218
222- const Int = @Type (.{ . int = .{ . bits = dest .bits , . signedness = source . signedness } } );
219+ const Int = @Int ( source . signedness , dest .bits );
223220
224221 if (dest .bits < source .bits )
225222 return @as (DestType , @bitCast (@as (Int , @truncate (target ))))
0 commit comments