Repository navigation
Fix preserved generic tuple binding in reflection mode - #7487
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@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. |
ReviewThe change is correct and well scoped. I found no blocking issues. What I checked
Minor notes (non-blocking)
Nice fix, and it was good to file #7485 for the separate source-generated nested-tuple failure instead of widening this PR. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
[Medium impact] The PR appears safe to merge; the previous long-tuple issue is fixed. SummaryFixes reflection-mode binding when a preserved tuple must match a closed generic parameter type.
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
Review of #7487The fix is sound and well tested. I found no blocking issues. What I checked
Non-blocking suggestions
Overall this looks good to merge once CI is green, particularly the .NET Framework leg, which you noted hasn't run locally. |
|
Reviewed every review surface for 4f3cdbc. Claude and Codex both report no blockers; the long-tuple thread is fixed and resolved. Disposition of Claude’s remaining non-blocking suggestions: retain the existing conversion exception behavior, consistent with CastHelper; a richer diagnostic is optional rather than necessary for correct tuple binding. Keep reading and construction shape handling local to their respective helpers for this focused fix; both follow the same seven-items-plus-Rest rule and the regressions exercise multiple Rest levels. The new private construction methods are covered by ReflectionTestDataCollector’s existing class-level trimming/AOT suppressions (including IL2070 and IL3050); they do not add a public reflection contract. Cache growth is bounded by encountered tuple types, as the reviewer noted. Promoting this reviewed head to ready. CI and the fresh ready-for-review Claude run will be handled by the next driver unit; auto-merge must wait for that Claude run and its findings to be checked. |
ReviewSolid, well-scoped fix. Rebuilding only incompatible tuples (and leaving compatible ones untouched) is the right call, since it preserves identity and avoids needless allocation. Caching constructors and member lookups is good for the hot path. Replacing the Minor suggestions (non-blocking):
No blocking concerns. Approving from my side, pending CI on the .NET Framework legs. |
|
The earlier wait is complete: run 41627181292 succeeded on 4f3cdbc, and all CI legs, including Windows/.NET Framework and native AOT, passed. Codex's current-head summary is completed with no findings; Claude's ready-for-review verdict has no blockers. The inline finding remains fixed and resolved, with no later replies. Disposition of the latest non-blocking suggestions: the tuple-member precondition is enforced immediately by UnwrapTupleUsingReflection's IsTupleType guard, and recursive calls consume only storage Rest. Keep that established guard without another comment. The legacy fallback tests already preserve a nested tuple in an Item slot; the distinct generated nested-binding limitation remains tracked in #7485. An ordinal prefix comparison would be a reasonable style improvement, but these fixed CLR tuple namespace prefixes have no demonstrated culture-dependent binding failure, so retain the existing comparison convention for this focused fix. CodeRabbit's docstring-coverage warning is advisory; the new helpers' purpose and Rest behavior are described in the code and existing API documentation, and no public API documentation is missing. No blocking or undecided review findings remain. Proceeding through the repository merge gate. |
A generic test taking
(T, object)now accepts a preserved(int, string)row in reflection mode after inferringT = int. The reflection invoker rebuilds incompatible tuple arguments against the closed parameter types, recursively handles long tuple Rest shapes, and preserves already compatible tuples. Tuple constructors and their argument types are cached. The netstandard2.0 tuple fallback also flattens Rest recursively for both ValueTuple and Tuple, with cached field/property lookups; nested tuples in Item slots stay intact. No public API or generator output changes.Closes #7482
Validation:
-m:1on net10.0/osx-arm64; all four regression cases pass individually in the native executable. Existing hook IL2075 warnings are tracked in Generated instance hooks emit IL2075 during Native AOT publishing #7430; dynamic-test IL2026 warnings describe intentionally unsupported AOT paths.An extra nested-tuple experiment exposed a separate source-generated conversion failure, filed as #7485; that failing experiment is excluded from this PR's regressions.
Follow-up validation (4f3cdbc):
Summary by CodeRabbit
Bug Fixes
Tests