Open joeldevahl opened 8 years ago
This is a known issues ( known by me ) and you can work around it in the same way as I have done in the unittests, by adding multiple "types" sections in the tld and manually order your types.
"types" : { "type_a" : {} }, "unions" : { "union_a" : { "members" : [ "type" : "type_a" ] } }, "types" : { "type_b" : { "members" : [ "type" : "union_a" ] } }
not perfect, but it works.
Ah, great! That is fine by me, though it would be nice if DL warned about it when compiling. Also nice since it doesn't change order of types between tld and header
Using a union in a type is valid in DL but generates a header where the union type is declared after the struct that uses it.
I can work around this by using a pointer to the union in the type but preferably I would like it built in. One solution would be to sort the types and unions on dependencies (types and union only depending on PODs first etc.)