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

Add tie-break for method overloads in derived classes #1452

Merged
merged 3 commits into from
Jul 3, 2023

Conversation

glopesdev
Copy link
Member

@glopesdev glopesdev commented Jul 3, 2023

This PR implements an additional tie-break for ambiguous overload resolution where, all else being equal, applicable overloads provided by a derived class are preferred to overloads provided by the base class.

According to the C# specs for signature scoping, for the purposes of this tie-break we should consider the declaring type of a virtual method to be the base definition, ignoring any overrides.

Fixes #1054

@glopesdev glopesdev added the fix Pull request that fixes an issue label Jul 3, 2023
@glopesdev glopesdev added this to the 2.8 milestone Jul 3, 2023
@glopesdev glopesdev merged commit 16ee135 into bonsai-rx:main Jul 3, 2023
@glopesdev glopesdev deleted the issue-1054 branch July 3, 2023 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull request that fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overload resolution is ambiguous if the same method signature is defined in a derived class
1 participant