For variant enums marked unchecked, we allow decoding the values of "unknown enumerators",
and when we do, we stuff it's data into a special Unknown enumerator which looks something like this:
public partial record class Unknown
{
int Discriminant,
global::System.ReadOnlyMemory<byte> Fields,
}
I propose we remove the 'Fields' property from it.
- We don't preserve the bytes from tags that we skip, and we recognized all of our old preserve-slicing logic as not useful. I don't see why the bytes of unknown enumerators is different.
- Either:
- The receiver has no idea what this discriminant is => these bytes are useful to them
- The receiver knows this discriminant => the correct fix is to add this enumerator to your Slice definitions
There is no case where these bytes can be useful, except for forwarding them along. But I find this very niche.
It is easy to add this preservation back in the future in case we reverse course, or someone wants it.
For variant enums marked unchecked, we allow decoding the values of "unknown enumerators",
and when we do, we stuff it's data into a special
Unknownenumerator which looks something like this:I propose we remove the 'Fields' property from it.
There is no case where these bytes can be useful, except for forwarding them along. But I find this very niche.
It is easy to add this preservation back in the future in case we reverse course, or someone wants it.