Skip to content
Discussion options

You must be logged in to vote

IIRC extension methods are not considered alongside instance methods in overload resolution. The compiler will only consider extension methods if there are no instance methods that can be used given the arguments provided.

I'd suggest renaming your extension method to AddRange, that is the convention used to add multiple elements to a collection in the BCL.

Replies: 5 comments

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
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
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #2579 on October 28, 2020 08:43.