NimYAML icon indicating copy to clipboard operation
NimYAML copied to clipboard

Future compile-time error in dom.nim

Open telatin opened this issue 2 years ago • 2 comments

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!

telatin avatar May 13 '22 10:05 telatin

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.

flyx avatar May 13 '22 11:05 flyx

Good to know :) Thanks for the prompt reply!

telatin avatar May 13 '22 13:05 telatin

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.

flyx avatar Aug 30 '23 17:08 flyx