-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Natural delegate type depends on order of candidates #71333
Comments
CC @cston |
CC @jjonescz |
It looks like the behavior was introduced in #64861. There could be a similar issue around optional parameters as well. Basically any aspect that is not considered as a difference by |
I think the expected behavior here are errors: var x1 = new Program().Test1; // error CS8917: The delegate type could not be inferred.
var x2 = new Program().Test2; // error CS8917: The delegate type could not be inferred. This is what also happens with
I.e., the candidate methods differ in signature, hence the method group has no natural type and CS8917 should be reported. |
@jjonescz |
Observed:
Type inferred for
x1
isAction<long[]>
, type inferred forx2
isvoid <anonymous delegate>(params long[] a)
Expected:
The same type is inferred, they differ only by order of candidates.
The text was updated successfully, but these errors were encountered: