Repository navigation
Lua dispatch: keep same-named classes of different packages in groups of their own - #1432
Conversation
… of their own A dispatch group's key named the class, the method and the types of its signature by name only, so two packages which each declare Box, First and Second shared one group for pick. The keys now end with the packages of the classes and type-variable owners they name, behind a separator which keeps the order of keys which differed before.
|
@codex review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 965b8a5be3
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The Lua dispatch preparation groups the methods of an override family into slots by a key made of names: the class, the method and its implementation, then the types of the signature, where a class is its name and a type variable its owner's name, position and name. Two packages may each declare a class of the same name, so two unrelated families could get the same key. Then they share one dispatch group, and their parameter signatures compare equal when aliases are chosen.
Two packages which each declare
Box<T>,First<T>andSecond<T>show it: both families ofpickwere bound to the one slotBox_pick. That program still ran correctly, because each class has its own table. I found no program where a shared key dispatches wrongly: Wurst cannot name two classes of the same name in one scope, and a class cannot hold two methods with the same name and signature. The keys break the rule that identity is not taken from names, though (AGENTS.md §7), and the alias selection relies on them.What changes
\u0001separator. The group key also ends with the package of the class it is named after.Effect
The two families get slots of their own (
Box_pick,Box_pick1), in any order of the compilation units. Castle fight and zombie defense compile byte-identical (-inline -localOptimizations, Lua); neither has such a pair. Not run in game.Tests
sameNamedGenericHierarchiesInTwoPackagesKeepTheirOwnDispatchGroupsand its new-generics twin (DeterministicChecks): run the program on Jass, in the interpreter and on Lua; check that each package'sFirstbindspickto its own slot; and check that the Lua is the same with the compilation units shuffled. Both fail on master.