Repository navigation
fix: reconstruct attacker, victim and removeFromArray value calls in convert --target opy - #762
Conversation
…convert --target opy A Set whose removeFromArray operand is its own target (plain or indexed, global or player) recompiles to a Modify form, so it is refused by construct name using the optimizer's structural self-reference predicate. Refs #744
|
LGTM VERIFIED on head Probes from rounds 1–3 of #758 and new ones, as Workshop text through
Tests: Gates on this head: PR body: |
Refs #724
Refs #744
Replaces the closed #758 (three review rounds, one defect class).
Change
convert --target opyreconstructs these value calls (reconstruct/value_literals.rs):attacker,victim,healer,healee(no arguments) as the bare OPY keyword;removeFromArray(array, value)as(array).exclude(value).A Set whose
removeFromArrayoperand is its own target recompiles to a Modify form (self_modificationincompiler/operator_optimization.rs).reconstruct/self_removal.rsdetects that shape by calling the same function on the Workshop action, so the comparison is structural (same variable, same player, same index value) and never a rendered-text comparison. The shape is refused withunsupported-value-callnamingremoveFromArray, for global and player variables, plain and indexed.indexed_targetmoved into that file soreconstruct.rsdoes not grow.Out of scope: the arithmetic indexed Set (#761).
Tests (
tests/reconstruction_self_removal.rs)Inputs are Workshop text, run in en-US and zh-CN (the zh-CN text is the same program re-emitted by
workshop_rs::emitter):g[(h + i) * 2]againstg[h + i * 2], global and player: round trip, not refused;The round-trip tests fail on main. The refusal tests fail with the guard call removed.
classification.jsondropsunsupported-value-callfrommysteryUltimates.Reproduction
attacker,victim,removeFromArray: refused on main, fixed here.array: fixed by fix: reconstruct array and workshop setting value calls in convert --target opy #748.__ambiguous_enum: no longer refused after fix: reconstruct computed and context-resolved enum-domain arguments #759; themysteryUltimatescorpus now refuses onlyunsupported-settings.Gates
fmt, clippy (stable and 1.88.0,
-D warnings),cargo test --workspace --all-targets --all-features,tools/overpy/tests,run_oracle.pyandrun_native.pypass.