Accept a new-generic type parameter as a keyed-table key - #1303
Conversation
|
@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: 37a46b33cf
ℹ️ 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. Keep them coming! 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 keyed-table key was typed
int, which forced every caller throughcastTo int— exactly the cost the old<T>containers pay and the reason a native Lua key was impossible: an integer index cannot be hashed as the element. This accepts a new-genericT:type parameter as the key instead. New generics are erased on Lua rather than cast, so the element arrives as itself and becomes the table key directly.Emitted Lua for a
unitkey, with no cast and no__wurst_classFromIndexround trip:intkeys stay accepted, so nothing that already compiled changes.Checks: 247 targeted tests across the Lua backend classes, 0 failures.
Known gap: membership is still a call to the stub rather than an index inlined at the call site — the deferred finding from #1302, unchanged here.