Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MaximLipnin
Copy link
Contributor

The following code

MemberInfo[] members = typeof(MyClassWithCtor).GetMember("*", MemberTypes.Constructor, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);

returns an empty array because * passed as search criteria becomes unexpected empty string later.
But .ctor or .ctor* works as expected.

The fix is to add a check for empty string.

@MaximLipnin
Copy link
Contributor Author

The original bug was caught by TypeTests_GetMember.TestMemberTypeCombos xunit test.

@MaximLipnin
Copy link
Contributor Author

@monojenkins build failed

@marek-safar marek-safar merged commit 5c4e4c5 into mono:master Oct 13, 2018
@MaximLipnin
Copy link
Contributor Author

Thanks for review!

@MaximLipnin MaximLipnin deleted the fix_GetConstructorCandidates branch October 14, 2018 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants