File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ pub const Mutable = struct {
340
340
}
341
341
342
342
const req_limbs = calcTwosCompLimbCount (bit_count );
343
- const bit = @as ( Log2Limb , @ truncate (bit_count - 1 ) );
343
+ const bit : Log2Limb = @truncate (bit_count - 1 );
344
344
const signmask = @as (Limb , 1 ) << bit ; // 0b0..010..0 where 1 is the sign bit.
345
345
const mask = (signmask << 1 ) -% 1 ; // 0b0..011..1 where the leftmost 1 is the sign bit.
346
346
@@ -2186,7 +2186,7 @@ pub const Const = struct {
2186
2186
return if (self .positive ) @as (T , @intCast (r )) else error .NegativeIntoUnsigned ;
2187
2187
} else {
2188
2188
if (self .positive ) {
2189
- return @as ( T , @ intCast (r ) );
2189
+ return @intCast (r );
2190
2190
} else {
2191
2191
if (math .cast (T , r )) | ok | {
2192
2192
return - ok ;
Original file line number Diff line number Diff line change @@ -1545,7 +1545,7 @@ pub const Type = struct {
1545
1545
0 = > .none ,
1546
1546
1... 8 = > .@"1" ,
1547
1547
9... 16 = > .@"2" ,
1548
- 17... 127 = > .@"4" ,
1548
+ 17... 64 = > .@"4" ,
1549
1549
else = > .@"16" ,
1550
1550
},
1551
1551
.x86_64 = > switch (bits ) {
Original file line number Diff line number Diff line change @@ -1077,3 +1077,13 @@ test "result location initialization of error union with OPV payload" {
1077
1077
_ = & c ;
1078
1078
try expectEqual (0 , (c catch return error .TestFailed ).x );
1079
1079
}
1080
+
1081
+ test "return error union with i65" {
1082
+ if (builtin .zig_backend == .stage2_wasm ) return error .SkipZigTest ;
1083
+
1084
+ try expect (try add (1000 , 234 ) == 1234 );
1085
+ }
1086
+
1087
+ fn add (x : i65 , y : i65 ) anyerror ! i65 {
1088
+ return x + y ;
1089
+ }
You can’t perform that action at this time.
0 commit comments