Skip to content
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

Merged
merged 6 commits into from
Apr 29, 2020

Conversation

mriehm
Copy link
Contributor

@mriehm mriehm commented Apr 29, 2020

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.

Copy link
Member

@stakx stakx left a 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).

@stakx
Copy link
Member

stakx commented Apr 29, 2020

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.)

@mriehm
Copy link
Contributor Author

mriehm commented Apr 29, 2020

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.

@jonorossi
Copy link
Member

@mriehm FYI the commits are mixed between these 2 email addresses:

  • mriehm@epic.com (no link to your account because this email address is not associated with your GitHub account)
  • 3916550+mriehm@users.noreply.github.com (this one got used because you edited files on the GitHub web site and you've got "Keep my email addresses private" set in GitHub's email settings)

@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.

@stakx stakx merged commit 0ac2f8a into castleproject:master Apr 29, 2020
@stakx
Copy link
Member

stakx commented Apr 29, 2020

to merge and update the changelog

Both done.

Thank you for contributing, @mriehm!

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.

3 participants