Skip to content

Fix implementing a generic interface with a Python class #1998

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

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

filmor
Copy link
Member

@filmor filmor commented Nov 2, 2022

What does this implement/fix? Explain your changes.

#1982

Does this close any currently open issues?

...

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Ensure you have signed the .NET Foundation CLA
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@filmor
Copy link
Member Author

filmor commented Nov 2, 2022

@lostmsu Do you have a hint what to do here? The issue is that MarshalByRefsBack calls MethodBase.GetMethodFromHandle(methodHandle) without also passing a RuntimeTypeHandle. Where would we get this type handle from?

@lostmsu
Copy link
Member

lostmsu commented Nov 2, 2022

@filmor I seem to be able to push directly to your repository o-O which I discovered trying to answer your question.

since RuntimeMethodHandle does not encode generic arguments, I had to supply RuntimeTypeHandle of the declaring type to be able to get fully specified method
@lostmsu lostmsu force-pushed the fix-derived-generic-interface branch from 522e21a to 5c1e02f Compare November 2, 2022 18:27
@filmor
Copy link
Member Author

filmor commented Nov 2, 2022

You can because you are a maintainer and I always enable that flag on PRs ;). Thanks for the fix!

@filmor filmor marked this pull request as ready for review November 2, 2022 18:33
@lostmsu
Copy link
Member

lostmsu commented Nov 2, 2022

missed a place in IR generator, should be working now

@filmor filmor merged commit cfe1585 into pythonnet:master Nov 2, 2022
@filmor filmor deleted the fix-derived-generic-interface branch November 2, 2022 18:39
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