Feature Request: Add support for MemoryPackUnion for non-abstract, non-interface classes.
Would it be a significant lift to add support for the MemoryPackUnion tag to non-abstract base classes? I've got a class hierarchy where there are specialized instances of a general class of objects, and often collections keep track of the general class of objects without worrying about the special instances. For example:
public class Employee { public string FirstName {get; set;} public string LastName {get; set;} public float Salary {get; set;} }
public class Manager : Employee { public List<Employee> Reports {get; set;} }
public class Team { public List<Employee> Members {get; set;} }
If I serialize a team where some members are employees, but some are employees who are also managers, when I deserialize, my list will only consist of employees, no managers anymore, because there's no way to add polymorphism.
It'd be possible to work around this by creating an IEmployee interface, but I'm working in a large code base where substituting all such usages would be a fair bit of manual labor, and also reduce the readability of the code only to serve the needs of MemoryPack and not the program's overall architecture.
If this solution is reasonable architecturally, I can contribute to implementation.