-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Add contravariance to RenderFragment<TValue> #64822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
57f3698
d87719d
5aeab86
79e819f
8422051
fc1e9cf
6ddd7fa
2353372
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,4 @@ namespace Microsoft.AspNetCore.Components; | |
| /// </summary> | ||
| /// <typeparam name="TValue">The type of object.</typeparam> | ||
| /// <param name="value">The value used to build the content.</param> | ||
| public delegate RenderFragment RenderFragment<TValue>(TValue value); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this public API change? Unshipped file does not need an update? With
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but the analyzer might not pick this up. To be clear, it's a public API change, but I don't believe this is breaking. |
||
| public delegate RenderFragment RenderFragment<in TValue>(TValue value); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a test with a struct and another test with a primitive type and another test with an enum
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added three additional tests as requested:
All tests validate contravariance works correctly through SetParametersAsync. Note: Direct value type contravariance (e.g., ValueType → int) isn't supported through the reflection-based parameter setter, so tests use reference type hierarchies. Commits: fc1e9cf, 6ddd7fa |
Uh oh!
There was an error while loading. Please reload this page.