Cysharp / MemoryPack

Zero encoding extreme performance binary serializer for C# and Unity.
MIT License
3.29k stars 193 forks source link

the "new" keyword causing member to be initialized twice in generated code. #72

Closed xiaoyuvax closed 1 year ago

xiaoyuvax commented 1 year ago

if u have a member in a MemoryPackable type like this, public new string Description { get; set; }

u'll get this in generated code:

   [global::MemoryPack.Internal.Preserve]
    public static void Deserialize(ref MemoryPackReader reader, scoped ref PluginInfo? value)
    {

        if (!reader.TryReadObjectHeader(out var count))
        {
            value = default!;
            goto END;
        }

        string __Description;
    ...
        string __Description;
     ...
}
neuecc commented 1 year ago

thanks! I've fixed and released.