Closed jon-edward closed 3 months ago
Which version of Nim are you using? I ran all the tests and tried compiling another project to make sure everything was working after my latest commits.
Something seems to have changed in a recent Nim version which caused the code to spit out warnings, fixing those warnings was not backwards compatible with older Nim versions. I guess keeping the warnings would've been better, I might revert that specific change.
Using 2.0.4 here
Could you try the latest? 2.0.6 as of writing
Sorry for the late response, upgraded to 2.0.8 and all is good. Closing now
For some reason, the cleanup is messing with compilation. The changes seemed relatively benign, which only adds to the confusion. It gives the error:
Here's a simple example of what I think is causing the issue:
Which is malformed to the Nim compiler and gives the error:
I added the assumed superfluous lines back, and all is well.
My guess is that the compiler can't infer that all case-of branches error or return the correct type at compile time, so an explicit return is required or all branches need to implicitly return the correct type even if they are stopped by
error
before execution would ever happen.This works, for example:
So does this:
Seems like you can disable
error
returning, which is probably the root cause of the issue.