flyx / NimYAML

YAML implementation for Nim
https://nimyaml.org
Other
186 stars 36 forks source link

Future compile-time error in dom.nim #107

Closed telatin closed 1 year ago

telatin commented 2 years ago

When using the last tag (v0.16) or the cloned repo, I get this warning with Nim 1.6.6

yaml/dom.nim(195, 3) 
Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]

Just reporting if you plan to update the code there, thanks for the library!

flyx commented 2 years ago

Frankly that warning has been around as long as this library. I won't believe this'll ever happen until it does.

I wouldn't know how to change the code to make this go away since the code does surely initialize result unless an exception is raised. Hence this warning is more a Nim bug than a NimYAML bug.

Thanks for reporting, but this is not something I plan to spend my time on. Leaving this open in case someone else wants to.

telatin commented 2 years ago

Good to know :) Thanks for the prompt reply!

flyx commented 1 year ago

The warning lied to us. We are now in the Nim 2.0.0 future and instead of becoming a compile time error, the warning is gone :)

Closing the issue.