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

Overload resolution improvements #377

Merged
merged 2 commits into from
Sep 15, 2024
Merged

Overload resolution improvements #377

merged 2 commits into from
Sep 15, 2024

Conversation

jasongin
Copy link
Member

@jasongin jasongin commented Sep 14, 2024

Fixes: #134
Fixes: #352

When JS calls a .NET method that has multiple overloads, the marshaller must resolve the best overload before invoking the method. Previously the overload resolution logic was pretty basic: it only considered the number of arguments and their JS value-types. This change makes the overload resolution much more sophisticated, so that it should work for almost all cases. It's still not perfect, but probably never can be due to the imperfect mapping between JS and .NET types.

See the updated overloaded-methods.md for further description.

This also fixes a bug when marshalling a JS Set object as .NET ICollection<T>.

@jasongin jasongin requested a review from vmoroz September 14, 2024 02:01
@jasongin jasongin merged commit 0056dbd into main Sep 15, 2024
24 checks passed
@jasongin jasongin deleted the dev/jasongin/overloads branch September 15, 2024 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants