-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
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
libp2p/crypto/minasn1.nim
doesn't build on Nim version-2-2
/devel
#1194
Comments
Thanks for reporting it. Could you please explain why it was an accident it worked at all? |
Araq in nim-lang/Nim#24125 (comment) notes:
|
What would you recommend here? I'm not sure this proc is necessary. |
template safeConvert*[T: SomeInteger](value: SomeOrdinal): T =
## Converts `value` to `T` iff `value` is guaranteed to be preserved.
when int64(T.low) <= int64(typeof(value).low()) and
uint64(T.high) >= uint64(typeof(value).high):
T(value)
else:
{.error: "Source and target types have an incompatible range low..high".} for example |
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 19, 2024
- fixes #1194. - fixes ambiguous `KeyError` - removes an unnecessary type param for `newSeqWith` - fixes tests for `safeConvert` The main fixes relate to Nim 2.2 being more strict and not accepting calls with a wrong number of type parameters.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nim-lang/Nim#24125
Not a terribly high-priority bug, but worth documenting here so no one else spends time hunting down the root cause of this.
The specific error one gets is:
and apparently was an accident it worked at all.
The text was updated successfully, but these errors were encountered: