Open
Description
Having type hierarchies across multiple files and projects will allow for extensible designs when the base class is in a consumed library. This would allow for something such as the following:
Project A
[GenerateImmutable(GenerateBuilder = true)]
public partial class NodeA
{
readonly string name;
readonly ImmutableHashSet<string> tags;
}
[GenerateImmutable(GenerateBuilder = true, DefineRootedStruct = true)]
public partial class Tree
{
readonly ImmutableSortedSet<Tree> children;
readonly NodeA node;
}
Project B
[GenerateImmutable(GenerateBuilder = true)]
public partial class NodeB : NodeA
{
readonly string mySpecializedProperty;
}
This will not work with the current way <Immutable>.To<InheritedType>()
works. Perhaps those methods should be moved to extension methods, but then CreateWithIdentity(...)
would have to become public and always generated.