DLR-based overload resolution #1278
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
This is an attempt to replace our custom (and in many cases borked) overload resolution with C#
RuntimeBinder
, that is used to implement C#'sdynamic
keyword.This should make our overload resolution nearly identical to C# overload resolution. It has full handling for:
params
, implicit conversions, type hierarchy, generics, overload prioritization, keyword arguments.A bonus feature is that supporting newer C# features in method binding should be as easy as simply updating the
Microsoft.CSharp
NuGet.Major consequences and further TODO
builtins.int
should return an instance ofPyInt
, which then should implement static or dynamic (e.g.TryConvert
) conversion toSystem.Int32
and/orSystem.Int64
in order to be used withvoid Foo(int arg)
.Does this close any currently open issues?
#1099 , specifically #1099 (comment)
Other comments
I am not sure how we could approach getting this done. Until the entirety of binding features are re-implemented with DLR, current tests will be failing. Perhaps a separate branch would be a good approach, where changes could be reviewed incrementally. @amos402 , @filmor , thoughts?
Checklist
Check all those that are applicable and complete.
AUTHORS
CHANGELOG