Repository navigation
Fix duplicate old-generic conversion in closure returns - #1446
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Expression-bodied closures reading an old-generic string container decode the value during expression translation, then decode it again when adapting the closure return. This emits nested
stringFromIndexcalls, invalid Jass, and a compile-time interpreter failure.Adapt the already-translated expression using its normalized type only when a
fromIndexconversion has decoded it, so it is decoded once. Preserve other generic bindings so Lua still restores primitive defaults when an erased result becomes a typed closure return. Add runtime and compile-time regression tests, Jass output assertions, new-generic controls, and integer/real/boolean default coverage on both backends. Supply the test Lua runtime'sFilterfactory needed by the imported stdlib initialization.Also test the bundled pjass argument-count boundary and document measurements on Warcraft III 3.0.0.24268: 31 parameters work, including a receiver/varargs/trace-shaped signature and a package-init call; 32-parameter calls cause client process exit and are already rejected by Wurst and pjass.
Validation: 343 tests passed across
ClosureTests, the fullLuaBackendAuditTestsclass,VarargTests, andPjassTests. Both old-generic repros failed with the original translation and passed with this fix. The CI primitive-default failure was reproduced locally before narrowing the normalization. Real-client probes verified every argument from runtime-derived values.Fixes #1445.