Skip to content

Recommendations how to add subtypes later #96

@freemin7

Description

@freemin7

Assuming i have a have piece of code which has an StructTypes.AbstractType() which already has it's StructTypes.subtypes(::Type{Vehicle}) set but i now want to add a new subtype at run time.

Is there a recommended way to do that? If so i would offer to extend the documentation with an example. My current solution would be StructTypes.subtypes(::Type{Vehicle}) = merge(StructTypes.subtypes(::Type{Vehicle}), (; train=Train)) but if there is a different way preferred with the package then i would like to know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions