Adding support for constrained open generics to DI#39540
Conversation
|
Tagging subscribers to this area: @eerhardt, @maryamariyan |
src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs
Show resolved
Hide resolved
|
Regarding test failures refer to the list here: https://dev.azure.com/dnceng/public/_build/results?buildId=735898&view=ms.vss-test-web.build-test-results-tab |
|
@maryamariyan fixed! |
|
@maryamariyan Anything else needed from my end? |
@jbogard the CI checks are green. Let's wait on @davidfowl 's approval on this. |
|
bump |
|
Reviewing this now |
… the generic type fails other than constraint failure
| { | ||
| closedType = descriptor.ImplementationType.MakeGenericType(serviceType.GenericTypeArguments); | ||
| } | ||
| catch (ArgumentException) |
There was a problem hiding this comment.
This exception happens once per service type right? Will get try to create the service with the wrong generic arguments more than once per service type?
There was a problem hiding this comment.
Yeah, exactly once per closed service type. Once it's correctly resolved the CallSite (well, IEnumerableCallSite), that result is cached like any other created CallSite.
|
Hello @maryamariyan! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Backed-out pull request: #34393
Previous pull request: dotnet/extensions#536
Original discussion: aspnet/DependencyInjection#471
Original pull request: aspnet/DependencyInjection#635
First naive pull request: aspnet/DependencyInjection#472
3rd4th time's the charm?All of the DI packages now support all of the specification tests added.