You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reflection rejects convertible types for a repeated generic tuple parameter #7481
A generic test accepting (T, T) passes with a method data source returning (int, long) in source-generated mode but fails during generic inference in reflection mode. Users switching discovery modes cannot run the same convertible tuple data.
Both modes should infer a compatible type and bind the row consistently. Source-generated mode passes; reflection mode throws GenericTypeResolutionException: Type mismatch: Cannot use argument of type 'ValueTuple2' for parameter of type 'ValueTuple2'.
TestGenericTypeResolver.TryInferTypeMapping rejects repeated type parameters unless their inferred types are exactly equal. It does not combine the numeric bounds as the generator does. Correcting inference also requires converting the preserved tuple to the closed parameter type before invocation.
Environment
.NET SDK 10.0.403, net10.0, macOS arm64. Reproduced at merge base 67870ed and on e1d8214; this predates #7469. Both generated probe cases passed on the PR head; this case failed in reflection mode on both commits.
Remaining work and acceptance criteria
Depends on #7482 for normalization of preserved tuple rows after generic inference. This issue owns repeated-type inference; reuse the binding fix from #7482 rather than implementing a second conversion path.
Infer the same compatible type as source-generated mode for (int, long) supplied to (T, T), including reversed element order.
Triaged against origin/main at 1f70564. TestGenericTypeResolver.TryInferTypeMapping still requires exact equality for repeated generic mappings. Even once inference selects long, (int, long) must be rebuilt as (long, long) before reflection invocation. Added native blocked-by #7482 and narrowed this issue to inference, reusing #7482 for binding. Both bugs remain open; #7469 explicitly tracks them as separate follow-ups.
Activity
thomhurst commentedon Nov 3, 2026
Triaged against origin/main at 1f70564.
TestGenericTypeResolver.TryInferTypeMappingstill requires exact equality for repeated generic mappings. Even once inference selectslong,(int, long)must be rebuilt as(long, long)before reflection invocation. Added native blocked-by #7482 and narrowed this issue to inference, reusing #7482 for binding. Both bugs remain open; #7469 explicitly tracks them as separate follow-ups.