Open termermc opened 2 years ago
reminder for me: the solution for this is to add a macro that can traverse from parent object to every inner fields and then construct a range initialization code if one of the fields in the hierarchy contains fields with requires init attribute. explicit {.requiresInit.} or implicit one like range should be taken into account.
Warnings (that will eventually turn into errors) are raised when unpacking to an object that has properties which are ranges.
Here is my object and the type definition for its property:
Unpacking it with the following code:
The compiler generates the following warning:
While this doesn't stop the code from compiling (for now), it does show as an error in the VS Code extension and is annoying in that way. The main issue here is the implication that this code may not compile in later versions of Nim. I believe that if the data being unpacked violates the range, that it should raise a
ObjectConversionDefect
, since that would be consistent.My
nim -v
output:Thanks! Other than this, your project has been working amazingly for me.