Bug description
In v2, [MessagePackObject] wasn't required for code generation to be able to serialize and deserialize the base type.
In v3, a field or property which includes [Union] but does not include [MessagePackObject] will not be serialized or deserialized in an AOT-compiled build; a MessagePack.FormatterNotRegisteredException is thrown indicating that the base type is not recognized.
Repro steps
- Create a new Unity project with MessagePack v3
- Configure the project to use IL2CPP
- Create an abstract base class with a [Union] attribute
- Instantiate a derived instance of that type at runtime.
- Serialize and deserialize it using an abstract reference.
- --> FormatterNotRegisteredException is thrown
Expected behavior
Either an analyzer should indicate that [MessagePackObject] is required on the abstract base class, or the attribute should not be necessary (similar to it not being needed for interfaces).
Actual behavior
A MessagePack.FormatterNotRegisteredException was thrown when attempting to serialize or deserialize an field or property of the abstract type.
- Version used: 3.1.4
- Runtime: Unity IL2CPP
Bug description
In v2, [MessagePackObject] wasn't required for code generation to be able to serialize and deserialize the base type.
In v3, a field or property which includes [Union] but does not include [MessagePackObject] will not be serialized or deserialized in an AOT-compiled build; a MessagePack.FormatterNotRegisteredException is thrown indicating that the base type is not recognized.
Repro steps
Expected behavior
Either an analyzer should indicate that [MessagePackObject] is required on the abstract base class, or the attribute should not be necessary (similar to it not being needed for interfaces).
Actual behavior
A MessagePack.FormatterNotRegisteredException was thrown when attempting to serialize or deserialize an field or property of the abstract type.