Skip to content

Commit

Permalink
Make ObjectFactory<T> covariant (#102553)
Browse files Browse the repository at this point in the history
  • Loading branch information
alrz authored Dec 5, 2024
1 parent 2f81513 commit 2300123
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static partial class KeyedService
public static object AnyKey { get { throw null; } }
}
public delegate object ObjectFactory(System.IServiceProvider serviceProvider, object?[]? arguments);
public delegate T ObjectFactory<T>(System.IServiceProvider serviceProvider, object?[]? arguments);
public delegate T ObjectFactory<out T>(System.IServiceProvider serviceProvider, object?[]? arguments);
public partial class ServiceCollection : Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Collections.Generic.ICollection<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.Generic.IList<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>, System.Collections.IEnumerable
{
public ServiceCollection() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ namespace Microsoft.Extensions.DependencyInjection
/// <param name="serviceProvider">The <see cref="IServiceProvider"/> to get service arguments from.</param>
/// <param name="arguments">Additional constructor arguments.</param>
/// <returns>An instance of type <typeparamref name="T" />.</returns>
public delegate T ObjectFactory<T>(IServiceProvider serviceProvider, object?[]? arguments);
public delegate T ObjectFactory<out T>(IServiceProvider serviceProvider, object?[]? arguments);
}

0 comments on commit 2300123

Please sign in to comment.