Skip to content
Discussion options

You must be logged in to vote

Currently methods with the same signature that differ only in their static annotation conflict at definition time.

I think the point is rather:

public class Foo
{
    public void Bar(object o) { }
    public static void Bar(int i) { }
}

new Foo().Bar(3);

Currently this picks the instance object overload. If static methods were also considered, this would pick the static int overload. Merely introducing this change could break existing code.

SharpLab

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YairHalberstadt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #3337 on November 24, 2020 11:04.