-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
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
Fix proxy generation for private protected constructors #491
Conversation
…ernal constructors
…ernal constructors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I have some trouble understanding the way the tests are written, (but that may just be me not yet fully awake).
You appear to have made commits with different Git user names. Do you want to do something about this before we merge the PR? (I'll wait for a while, just in case.) |
Sorry, I'm still pretty unfamiliar with Github and Git in general (use different source control at work), so I'm not exactly sure how I would go about fixing the inconsistency and it doesn't seem like something worth spending too much time investigating unless you disagree. So, you can just go ahead and commit this as it is now. Thanks. |
@mriehm FYI the commits are mixed between these 2 email addresses:
@stakx we should just squash and merge the 6 commits anyway to keep the history clean in this case. I'll leave it to you to merge and update the changelog. |
Both done. Thank you for contributing, @mriehm! |
Previously, it would not be possible to generate a proxy of a class with just a private protected constructor. This is because BaseProxyGenerator.IsConstructorVisible() did not check for the case of MethodBase.IsFamilyAndAssembly.
Now, we remove BaseProxyGenerator.IsConstructorVisible() and replace the call to it with a call to ProxyUtil.IsAccessibleMethod(), which has identical behavior as BaseProxyGenerator.IsConstructorVisible() except that it does already correctly handle MethodBase.IsFamilyAndAssembly.