Repro
tmp=$(mktemp -d /tmp/goboscript-show-unused-XXXXXX)
printf 'costumes "blank.svg";\n\n' > "$tmp/stage.gs"
printf 'costumes "blank.svg";\n\nstruct Pair { x, y }\nvar Pair p = Pair { x: 1, y: 2 };\n\nonflag {\n show p;\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"
Observed:
warning: unused struct Pair
warning: unused struct field x (never read)
warning: unused struct field y (never read)
show p; expands to monitor operations for p.x and p.y, but reference marking ignores Stmt::Show/Stmt::Hide, so the struct and fields are still reported unused.
Expected
show/hide statements should count as uses of the variable/list they target. For struct values, expanded monitor statements should mark the struct and generated fields as used.
Repro
Observed:
show p;expands to monitor operations forp.xandp.y, but reference marking ignoresStmt::Show/Stmt::Hide, so the struct and fields are still reported unused.Expected
show/hidestatements should count as uses of the variable/list they target. For struct values, expanded monitor statements should mark the struct and generated fields as used.