We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using Format.int[U128] or Format.int[I128], it always ends up running the logic from _FormatInt.u64.
Format.int[U128]
Format.int[I128]
_FormatInt.u64
This is happening because of the identity conditionals in Format.int[A] return false, as x is never identical to an uninstantiated primitive.
Format.int[A]
x
if x is U128 then _FormatIntt.u128(x.u128(), false, fmt, prefix, prec, width, align, fill) elseif x is I128 then _FormatIntt.u128(abs.u128(), neg, fmt, prefix, prec, width, align, fill) else _FormatIntt.u64(abs.u64(), neg, fmt, prefix, prec, width, align, fill) end
To reproduce:
use "format" actor Main new create(env: Env) => let u128_max: U128 = U128.max_value() let s128_max = Format.int[U128](where x=u128_max, fmt=FormatHexBare) let s128_max': String val = consume s128_max env.out.print("Expected: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") env.out.print("Got: " + s128_max') try let u128_decoded = s128_max'.u128(16) env.out.print("Original: " + u128_max.string()) env.out.print("Formtted + parserd: " + u128_decoded.string()) end
The text was updated successfully, but these errors were encountered:
This will be fixed in the 0.15 release, which should happen soon. The fix was done in #1927.
Sorry, something went wrong.
Ah! Sorry for the duplicate! I must have missed it when I was searching for existing issues related to this.
No worries, it's better to have a bug reported twice than never.
No branches or pull requests
When using
Format.int[U128]
orFormat.int[I128]
, it always ends up running the logic from_FormatInt.u64
.This is happening because of the identity conditionals in
Format.int[A]
return false, asx
is never identical to an uninstantiated primitive.To reproduce:
The text was updated successfully, but these errors were encountered: