Repository navigation
fix: reconstruct computed and context-resolved enum-domain arguments - #759
Merged
Merged
Conversation
Computed values, null and arrays of members are accepted for enum-domain parameters, and shared constants (Left, Up, All) resolve to the parameter's domain. A shared constant with no selecting domain is refused by name. Refs #746.
Contributor
|
LGTM Verified on head 4d625e1 with my own 50-program probe, each compiled, parsed, reconstructed, recompiled and compared with
|
This was referenced Nov 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #724
Fixes #746
Cause
check_param_argumentaccepted only enum literals for a parameter with an enum domain. A computed value (call, variable),null, an array of members, or a shared constant (Left,Up,All, which Workshop text parses to__ambiguous_enum) was refused asunsupported-enum-domain-mismatch.Change
reconstruct/enum_domain_args.rsholds the domain check (moved out ofreconstruct.rs, which shrinks). It keeps computed values,nulland arrays as they are and resolves a shared constant to the member in the parameter's domain.Up * x).__ambiguous_enumvalue call.Reproduced (each call had its own reproducer, en-US and zh-CN)
All six refused with wright 0.44.0 and now round-trip to a canonically equal program:
setAllowedHeroes(array literal,getAllHeroes(), variable),getLivingPlayers/getOppositeTeam(getTeam(), nested call,Team.2),getPlayers,applyImpulseandstartThrottleInDirection(directionTowards,getFacingDirection()),worldVector(Vector.LEFT, computed). The Issue's note thatapplyImpulse/worldVector/team calls did not refuse holds only for literal constants; computed arguments refuse. No call was dropped.__ambiguous_enuminaram.owwas this problem: 5 refusals with 0.44.0 onOverwatch-AI-PVE/build/aram.ow, none remain. Another__ambiguous_enum(Upas amultiplyoperand) in PVEmain.zh-CN.owis fixed by the arithmetic rule.Not delivered
truein aColorslot (hudText, PVEmain.zh-CN.ow) has no OPY form:wright compilerejects it withargument 7 must have semantic type 'Color', got Boolean. It still refuses, naming the argument and domain.Tests
tests/reconstruction_enum_domain_args.rs: round trip in en-US and zh-CN; it fails on main with the refusals above. Ablating the arithmetic rule fails it.mysteryUltimatesno longer yieldsunsupported-enum-domain-mismatch;classification.jsonupdated.opy-providerlpp refusal test: its fixture got its enum-domain issue from a shared constant, which now resolves; it asserts the two remaining codes.-D warnings(stable and 1.88.0),cargo test --workspace --all-targets --all-features,run_oracle.py,run_native.py,tools/overpy/testsall pass.