Currently CompositionGraph::define_type allows for exporting a named type from the composition.
However, the node it creates in the graph has no dependency edges on other defined types that might be referenced from the type definition.
The result is that the toposort performed when the graph is encoded does not properly order the types such that they are in correct topological order (although the ordering is a stable one).
The fix is to add a "depends on" edge from the node to any defined type referenced from the type being defined.
Currently
CompositionGraph::define_type
allows for exporting a named type from the composition.However, the node it creates in the graph has no dependency edges on other defined types that might be referenced from the type definition.
The result is that the toposort performed when the graph is encoded does not properly order the types such that they are in correct topological order (although the ordering is a stable one).
The fix is to add a "depends on" edge from the node to any defined type referenced from the type being defined.