-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix(transport): libp2p compilation in Nim version-2-0 #1186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. What is the cause of the issue? Was it implemented in a wrong, but supported way? This code hasn't changed for more than 2 years. |
Some change from post-Nim 2.0.8 For another, close example of Nim 2.0.8 already disallowing/being confused by this incorrect return type declaration: template g(body: untyped) =
try:
body
except CatchableError:
raiseAssert ""
discard g(0) yields
i.e. it was specifically that |
The error message seems a bit confusing. In the original error, it gets used, and your example is discarded. |
Not in a relevant way. Same error message: template g(body: untyped) =
try:
body
except CatchableError:
raiseAssert ""
let t = g(0)
|
The error message mentions the line where it is used. |
Yes, it's a template. It doesn't really exist until it's instantiated. |
For example:
from https://github.com/vacp2p/nim-libp2p/actions/runs/10655841970/job/29533846606?pr=1145
For minimal example of this:
Also, even in 2.0.8, a variation doesn't work: