IronLanguages / ironpython3

Implementation of Python 3.x for .NET Framework that is built on top of the Dynamic Language Runtime.
Apache License 2.0
2.43k stars 284 forks source link

Extension binder fails to resolve overloads with nested generics #1796

Open slozier opened 2 months ago

slozier commented 2 months ago

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.