Skip to content

Fix tuple-valued generic index reads in conditional arguments - #1636

Merged
Frotty merged 1 commit into
masterfrom
codex/fix-generic-index-conditional
Nov 22, 2026
Merged

Frotty merged 1 commit into
masterfrom
codex/fix-generic-index-conditional

Conversation

@Frotty

@Frotty Frotty commented Nov 22, 2026

Copy link
Copy Markdown
Member

Closes #1635.

A direct call to op_index on Box<Pair> reported the declaration’s return type T before generic elimination. A conditional used that type for its result temporary. Jass rejected the unresolved type variable, and Lua lost the tuple components.

Resolve the return type of a direct instance call using the receiver’s type arguments, including when the method is inherited. The call keeps its existing direct dispatch.

The regression passes the conditional directly to a function and checks both tuple components from both branches, with a direct and an inherited getter. The original compiler fails the regression with Type variable T not eliminated.

On Windows, 172 tests passed across OpOverloading, GenericsTests, GenericsModuleTests, and TupleTests with -PallBackends=full. The emitted Lua assigns and passes both tuple components. Linux, macOS, and the Warcraft III client were not tested locally.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T08:40:55.368412Z ae1ef83 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty
Frotty merged commit 6f62037 into master Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

? : passed directly as an argument loses its value when a branch uses [] on a generic class with a tuple type argument

1 participant