Thanks @araq, how about allowing that pragma {.fieldChecks: on|off.} in the
prog header, so that it would only affect its own scope?
> So my question is, can that pragma be documented?
Consider it done.
proc `$`(mo: MyObj): string =
Run
doesn't need to be surrounded by field checks off. You have a bug in your code.
of mk2: result &= "u:" & $mo.x & ", v:" & $mo.y & ", w:" & $mo.z
Run
should be
of mk2: result &= "u:" & $mo.u & ", v:"
It sounds reasonable that the discriminator of an object variant should be kept
invariable to keep the object's data structure safe; I found, however, some
scenarios in which it can be done. One way was to use the compiler directive
--fieldChecks:off. I also attempted the same, but using the