Best way to represent inheritance?
My use-case is basically a stream of serialized instances of classes from the hierarchy, each instance prefixed by type code.

As far as I understand, Kaitai doesn't support struct inheritance (yet?), so it's not really possible for types to "inherit" some common fields from a common ancestor type.

What's the best way of "emulating" it?

I see several options:

1) Include "base class" as a kind of `base` subfield into types representing children classes and use generic TLV. 
+: No code duplication here, great readability. 
-: But then with the generated code I'll have to do stuff like `MyObject.base.base.base.field_1`, and what's even worse - the access level will vary depending on a type's position in the hierarchy.

2) Include all fields of all base classes into each type representing a child class and use generic TLV. 
+: No indirection problems, mediocre readability
-: Code duplication sucks in case I have to edit something manually (and I'll probably have to)

3) Include all fields of all classes from the hierarchy into one type and make them conditional on the type code. 
+: No code duplication, no indirection problems.
-: Readability in case of deep and wide hierarchy sucks.

4) (variation of 1): put types representing child subclasses as a "TLV tail" into base class. Pros and cons are basically the same, except there'll be an additional level of indirection in .ksy code itself, because each child class will have to refer to (grand-grand-grand)parent's `type` field.

Maybe there's some other solution I'm not familiar with? I'm not really concerned about _writing_ the .ksy code (it'll be autogenerated), only with _reading_, _editing_ and _using_ it.