status-im / nim-confutils

Simplified handling of command line options and config files
Apache License 2.0
62 stars 16 forks source link

"assignment to discriminant changes object branch" #9

Open stefantalpalaru opened 4 years ago

stefantalpalaru commented 4 years ago

Compile time:

/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-confutils/confutils.nim(597, 27) Warning: Potential object case transition, instantiate new object instead [CaseTransition]
/mnt/sda3/storage/CODE/status/nim-beacon-chain/vendor/nim-confutils/confutils.nim(599, 27) Warning: Potential object case transition, instantiate new object instead [CaseTransition]

Run time (in nim-beacon-chain, running make eth2_network_simulation):

Error while processing the 'cmd' parameter:
assignment to discriminant changes object branch; compile with -d:nimOldCaseObjects for a transition period
zah commented 4 years ago

The new more restrictive behavior of the Nim case object makes life too difficult for libraries such as nim-seriazation and nim-confutils. For this reason, I recommend setting -d:nimOldCaseObjects globally for all of our projects. I'll try to negotiate a new Nim feature that will solve the problem in the long run.

stefantalpalaru commented 4 years ago

setting -d:nimOldCaseObjects globally

I just did that for nim-beacon-chain. Will do the same for Nimbus.

mratsim commented 4 years ago

See also: https://github.com/nim-lang/RFCs/issues/56

jangko commented 2 years ago

still need support from nim compiler to fix this issue, see this bug nim-lang/Nim#19547