Kaitai generates switch statements where the selector expression is of type long. This is a violation of the Java SE Specification (§:14.1.1) which states that
switch blocks are not designed to work with the types boolean, long, float, and double. The selector expression of a switch statement or switch expression can not have one of these types.
Impact
This bug prevents generated code from compiling successfully. The Java compiler will flag an error because long is not a valid data type for switch selectors.
> Task :compileJava FAILED
/home/runner/work/ExciteModder/ExciteModder/build/generated/kaitai/com/gamebuster19901/excite/modding/game/file/kaitai/ResMonster.java:158: error: selector type long is not allowed
switch (_root().header().compressed()) {
^
Problem
Kaitai generates switch statements where the selector expression is of type long. This is a violation of the Java SE Specification (§:14.1.1) which states that
Impact
long
is not a valid data type for switch selectors.Example
.ksy file (lines 43-44 and 62-65): https://github.com/TheGameCommunity/ExciteModder/blob/dda55f7e5ce7970467caf79feee2c0306ac3ac73/src/main/resources/kaitai/monster_res.ksy#L62-L65
generated code (lines 129 and 158 only): https://github.com/TheGameCommunity/ExciteModder/blob/dda55f7e5ce7970467caf79feee2c0306ac3ac73/build/generated/kaitai/com/gamebuster19901/excite/modding/game/file/kaitai/ResMonster.java#L129-L158
Build Error: