IronLanguages / IronLanguages/ironpython3
Extension binder fails to resolve overloads with nested generics
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the assertion by running test_cliclass.test_extension_methods in Debug mode, using the nested-generic ToDictionary overload described in the issue. Trace extension binder overload resolution for IEnumerable<KeyValuePair<object, object>> and verify that the test passes when the overload is callable without an assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, python
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100