det-lab / kaitai_struct_awkward_runtime

Kaitai Struct: runtime for Awkward Arrays
MIT License
2 stars 2 forks source link

fix: `UnionBuilder` for `SwitchType` #16

Closed ManasviGoyal closed 11 months ago

ManasviGoyal commented 11 months ago

For ksy files with SwitchType, we need a UnionBuilder. Currently, we have an implementation for it but it only works when the UnionBuilder types and primitive. It fails for UserType.

ManasviGoyal commented 11 months ago

I realised that this issue isn't exactly with just union but this error will be thrown every time we have type that is used as the type of more that one id. In these cases, the parent is of kaitai::kstruct type so we need to know the parent somehow so that we can add the reference of the parent builder to the current builder.