Closed ruz closed 6 years ago
What was outcome? What was expected? Why don't you agree with outcome?
Outcome:
Expected variants:
I understand why it happens, but it took quite a lot of time to discover.
I think you may be trying to be push the limits of the package, so it works in quirky ways, that may not be true from one version to the next.
The rule is that we update the interface with the appropriate value ie formerly a ptr to a string, now becomes a string per what was in the stream.
Anything else, and I will have to explain to someone else who expected the simpler model to work.
This is working as designed.
PS the error on decode is not a viable outcome, because you can decide a string into an interface holder. There if no concept of a warning in the library ie it works or fails. The only viable expected outcome is the 3rd one, but it goes against the simple way the package works.
Can this behaviour be prevented and/or detected? What do you think? If we increase size of res to match data then target will be set. I know that this is questionable and subject to discuss.