-
Notifications
You must be signed in to change notification settings - Fork 717
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
Python classes cannot inherit from C# interfaces that themselves inherit from C# interfaces with methods #2526
Comments
And it was impossible for you to write the small additions in the converted discussion? On topic: If you want to debug this a bit more and provide a fix, this is where the sub-classes are generated: pythonnet/src/runtime/TypeManager.cs Line 377 in 0ea1d29
|
It's a bug! Why would you convert it to a discussion unless you think this is intended behavior?
I will have a look, but I was unable to build this project now that xbuild support has been removed. So I can't really work on a fix. |
This is not for you to decide. In the original post, your example had an obvious error that was pointed out to you. You could have easily answered on that thread instead of opening a new issue with almost entirely the same content.
The project can be built straight with |
This was not an error. I simply omitted it to make the example clearer. The following code import clr
clr.AddReference('A')
import A
class E(A.B):
__namespace__ = 'F' produces no errors. It is only when invoking
This is not packaged on Debian/Ubuntu. Maybe at some point I will get around to it. |
That's a third-party package... |
|
Python classes cannot inherit from C# interfaces that themselves inherit from C# interfaces with methods:
Output:
Extending from
B
works. It also works ifC
is removed fromB
.Possibly related to #2511. Reverting to 3.0.3 (before 9ebfbde) provides the moderately-more-useful error
TypeError: VTable setup of type F.E failed
.Please do NOT convert this to a discussion. It is a real bug that requires fixing. As noted above, providing a definition for
C
does not affect whether the bug occurs.I have tested this with mono 6.8 and 6.12, as well as with MSCV. The latter gives the slightly-different error:
Note that
C
was defined as above.As a workaround, the following can be done...
And for some reason C has to be implemented in G and not E:
The text was updated successfully, but these errors were encountered: