runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Activator.CreateInstance<T> with params?

Open weitzhandler opened this issue 7 years ago • 6 comments

Can we have another overload of the generic Activator.CreateInstance<T> such that accepts a params object[] args like the non-generic one?

weitzhandler avatar Dec 24 '18 23:12 weitzhandler

Added in https://github.com/dotnet/coreclr/pull/21675

ichensky avatar Dec 25 '18 16:12 ichensky

Usually every new public api should follow review process outlined here https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/api-review-process.md

MarcoRossignoli avatar Dec 25 '18 17:12 MarcoRossignoli

@MarcoRossignoli I know I honestly didn't know what else to write since this suggestion is so short and self-descriptive. And in that note @ichensky, PRs should be submitted upon API review and approval.

weitzhandler avatar Dec 25 '18 17:12 weitzhandler

And in that note @ichensky, PRs should be submitted upon API review and approval.

I meant that :)

MarcoRossignoli avatar Dec 25 '18 17:12 MarcoRossignoli

Can you describe the scenario a bit further? What's the benefit of having this API over calling (T)Activator.CreateInstance(typeof(T), ...)?

GrabYourPitchforks avatar Jan 24 '20 21:01 GrabYourPitchforks

Closing this out as there has been no response and the scenario for adding this over using the existing API is not clear. Please reopen if the scenario can be clarified.

GrabYourPitchforks avatar Mar 04 '20 22:03 GrabYourPitchforks