Repro
tmp=$(mktemp -d /tmp/goboscript-enum-mixed-XXXXXX)
printf 'costumes "blank.svg";\n\n' > "$tmp/stage.gs"
printf 'costumes "blank.svg";\n\nenum Direction {\n A = "A",\n B,\n C = "C",\n D,\n E = 2,\n F,\n}\n\nonflag {\n say Direction.B;\n say Direction.D;\n say Direction.F;\n}\n' > "$tmp/main.gs"
printf '<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"></svg>\n' > "$tmp/blank.svg"
cargo run --quiet -- build "$tmp"
python3 - <<'PY' "$tmp/$(basename "$tmp").sb3"
import json, sys, zipfile
with zipfile.ZipFile(sys.argv[1]) as z:
p=json.loads(z.read('project.json'))
blocks=p['targets'][1]['blocks']
for b in blocks.values():
if b.get('opcode') == 'looks_say':
print(b['inputs']['MESSAGE'])
PY
Observed message constants:
[1, [4, 0]]
[1, [4, 1]]
[1, [4, 2]]
So Direction.F compiles to 2 even though Direction.E is also explicitly 2.
Docs in docs/language/enums.md show this exact mixed enum pattern and mark F as 3.
Expected
After an explicit numeric enum value, the next implicit enum value should continue at the following number. Here Direction.F should compile to 3.
Repro
Observed message constants:
So
Direction.Fcompiles to2even thoughDirection.Eis also explicitly2.Docs in
docs/language/enums.mdshow this exact mixed enum pattern and markFas3.Expected
After an explicit numeric enum value, the next implicit enum value should continue at the following number. Here
Direction.Fshould compile to3.