-
Notifications
You must be signed in to change notification settings - Fork 704
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
Exception when importing a C++/CLI assembly using "operator -" #2261
Labels
Comments
I'll have a look. Especially for edge cases like these, PRs are appreciated. I don't have an MSVC build setup available right now. |
Here is the assembly so you do not need to recompile it with MSVC: I am not sure about the purpose of this IsReverse function but adding a trivial check should fix this bug. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Details
Importing a .net assembly written in C++/CLI using a very specific way to define an operator result in an exception:
This can be reproduce with the minimal code (C++/CLI):
See Operator.zip
Investigation
It seems there is two way to define the operator- in C++/CLI:
And
There is no issue when using the second form. Actually in C# only the equivalent of the second form is possible. It explains why this bug is very uncommon.
Source of the exception
The code in pythonnet code triggering this exception (src/runtime/Types/OperatorMethod.cs)
The exception is thrown because GetGenericArguments return an empty list.
The text was updated successfully, but these errors were encountered: