We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
class C { internal C(int i) { } C M() => (C)Activator.CreateInstance(typeof(C), 1); }
The text was updated successfully, but these errors were encountered:
Not sure what the best code is if we write a fix, maybe:
class C { internal C(int i) { } C M() => (C)Activator.CreateInstance(typeof(C), BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, new object[] { 1 }, null, null); }
Sorry, something went wrong.
BindingFlags.CreateInstance is only relevant when calling the Type.InvokeMember method. https://docs.microsoft.com/en-us/dotnet/api/system.reflection.bindingflags?view=netcore-3.1#System_Reflection_BindingFlags_CreateInstance
BindingFlags.CreateInstance
Type.InvokeMember
No branches or pull requests
The text was updated successfully, but these errors were encountered: