Sema: fix parameter of type 'T' must be comptime error

Closes #12519
Closes #12505
This commit is contained in:
Veikka Tuominen
2022-08-21 18:04:46 +03:00
parent b2f02a820f
commit b55a5007fa
14 changed files with 51 additions and 22 deletions

View File

@@ -8,7 +8,7 @@ inline fn mantissaOne(comptime T: type) comptime_int {
}
/// Creates floating point type T from an unbiased exponent and raw mantissa.
inline fn reconstructFloat(comptime T: type, exponent: comptime_int, mantissa: comptime_int) T {
inline fn reconstructFloat(comptime T: type, comptime exponent: comptime_int, comptime mantissa: comptime_int) T {
const TBits = @Type(.{ .Int = .{ .signedness = .unsigned, .bits = @bitSizeOf(T) } });
const biased_exponent = @as(TBits, exponent + floatExponentMax(T));
return @bitCast(T, (biased_exponent << floatMantissaBits(T)) | @as(TBits, mantissa));