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

Extension binder fails to resolve overloads with nested generics #1796

Open
slozier opened this issue Apr 25, 2024 · 0 comments
Open

Extension binder fails to resolve overloads with nested generics #1796

slozier opened this issue Apr 25, 2024 · 0 comments
Labels
.NET interop Issues relating to how IronPython interacts with .NET types

Comments

@slozier
Copy link
Contributor

slozier commented Apr 25, 2024

For example, in .NET 8 the following overload is added:

public static Dictionary<TKey,TValue> ToDictionary<TKey,TValue> (this IEnumerable<KeyValuePair<TKey,TValue>> source);

Since PythonDictionary is an IEnumerable<KeyValuePair<object, object>> the extension method should be callable:

import clr
clr.AddReference("System.Linq")
from System.Linq import Enumerable
clr.ImportExtensions(Enumerable)
{}.ToDictionary()

This causes an assertion error when running test_cliclass.test_extension_methods in Debug mode.

@slozier slozier added the .NET interop Issues relating to how IronPython interacts with .NET types label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET interop Issues relating to how IronPython interacts with .NET types
Projects
None yet
Development

No branches or pull requests

1 participant