-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Overloading on in/byval should cause an error #22132
Comments
@VSadov, why would that cause an error (I'm guessing a language design decision)? I would expect a user is allowed to differentiate by This makes adding This is a bit confusing, because users are allowed to add a |
Right now there is no way to guide overload resolution at the call site. Anyways, as it is currently would not be possible to call either of the overloads, we will disallow such situations. Once/if it is possible to disambiguate, we can relax the restriction. |
@VSadov do we have a decision on this? should we move this to |
It is not officially confirmed, but otherwise nearly decided to allow this kind of overloading, even when it is not callable (if common, we can introduce disambiguating syntax at call site in the future). |
It is confirmed with LDM to be ok. |
@VSadov, do you have a link to the design notes? |
The following seems to not result in an error, but should:
We should also add tests to make sure we select the correct overload, also in case of in situation of ambiguity (because of inheritance or extension methods)
The text was updated successfully, but these errors were encountered: