You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try updating to the latest development compiler version. I can spot a known problem to me in the code which always occurred when using type-switching with user types and disabled autoRead (when _read() is not called automatically from the class constructor).
Because KaitaiStruct and byte[] are incompatible types, the property is declared few lines below as private Object body;.
The core of the issue is that the combined type of the switch does not contain the method _read() because it is "polluted" with unrelated types from other cases (e.g. byte[], String, int etc.) Despite that we know in the particular switch branch that calling _read does make sense, the Java compile-time type checking engine does not and we have to cast it before.
But it should be fixed now since commit kaitai-io/kaitai_struct_compiler@872f8c2, so please check it out. The issue is described in kaitai-io/kaitai_struct#204 and the related test is called DebugSwitchUser (but as I can see in the generated DebugSwitchUser.java:129, the combined type there is KaitaiStruct, not Object, so it could be faked with no casting but adding _read() as abstract method to KaitaiStruct - so it's not testing the worst case).
Built using intelliJ idea maven 3 jdk12
In generated java source there are some cases of error: cannot find symbol this.body._read();
generated java code dump
The text was updated successfully, but these errors were encountered: